page.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <?php
  2. use PrivateBin\I18n;
  3. ?><!DOCTYPE html>
  4. <html lang="<?php echo I18n::_('en'); ?>">
  5. <head>
  6. <meta charset="utf-8" />
  7. <meta name="robots" content="noindex" />
  8. <meta name="google" content="notranslate">
  9. <title><?php echo I18n::_($NAME); ?></title>
  10. <link type="text/css" rel="stylesheet" href="css/privatebin.css?<?php echo rawurlencode($VERSION); ?>" />
  11. <?php
  12. if ($SYNTAXHIGHLIGHTING):
  13. ?>
  14. <link type="text/css" rel="stylesheet" href="css/prettify/prettify.css?<?php echo rawurlencode($VERSION); ?>" />
  15. <?php
  16. if (strlen($SYNTAXHIGHLIGHTINGTHEME)):
  17. ?>
  18. <link type="text/css" rel="stylesheet" href="css/prettify/<?php echo rawurlencode($SYNTAXHIGHLIGHTINGTHEME); ?>.css?<?php echo rawurlencode($VERSION); ?>" />
  19. <?php
  20. endif;
  21. endif;
  22. ?>
  23. <script type="text/javascript" data-cfasync="false" src="js/jquery-3.4.1.js" integrity="sha512-bnIvzh6FU75ZKxp0GXLH9bewza/OIw6dLVh9ICg0gogclmYGguQJWl8U30WpbsGTqbIiAwxTsbe76DErLq5EDQ==" crossorigin="anonymous"></script>
  24. <?php
  25. if ($QRCODE):
  26. ?>
  27. <script async type="text/javascript" data-cfasync="false" src="js/kjua-0.6.0.js" integrity="sha512-GEEIHvphDt1NmaxzX8X1ZkBiGKXCv+Ofzwi8SMEH5wQVWqdGIvBO/fnxxKZ90RU1bVp6srS68nHIpZo6iVcG9g==" crossorigin="anonymous"></script>
  28. <?php
  29. endif;
  30. if ($ZEROBINCOMPATIBILITY):
  31. ?>
  32. <script type="text/javascript" data-cfasync="false" src="js/base64-1.7.js" integrity="sha512-JdwsSP3GyHR+jaCkns9CL9NTt4JUJqm/BsODGmYhBcj5EAPKcHYh+OiMfyHbcDLECe17TL0hjXADFkusAqiYgA==" crossorigin="anonymous"></script>
  33. <?php
  34. endif;
  35. ?>
  36. <script type="text/javascript" data-cfasync="false" src="js/zlib-1.2.11.js" integrity="sha512-Yey/0yoaVmSbqMEyyff3DIu8kCPwpHvHf7tY1AuZ1lrX9NPCMg87PwzngMi+VNbe4ilCApmePeuKT869RTcyCQ==" crossorigin="anonymous"></script>
  37. <script type="text/javascript" data-cfasync="false" src="js/base-x-3.0.7.js" integrity="sha512-/Bi1AJIP0TtxEB+Jh6Hk809H1G7vn4iJV80qagslf0+Hm0UjUi1s3qNrn1kZULjzUYuaf6ck0ndLGJ7MxWLmgQ==" crossorigin="anonymous"></script>
  38. <script type="text/javascript" data-cfasync="false" src="js/rawinflate-0.3.js" integrity="sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==" crossorigin="anonymous"></script>
  39. <?php
  40. if ($SYNTAXHIGHLIGHTING):
  41. ?>
  42. <script type="text/javascript" data-cfasync="false" src="js/prettify.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==" crossorigin="anonymous"></script>
  43. <?php
  44. endif;
  45. if ($MARKDOWN):
  46. ?>
  47. <script type="text/javascript" data-cfasync="false" src="js/showdown-1.9.1.js" integrity="sha512-nRri7kqh3iRLdHbhtjfe8w9eAQPmt+ubH5U88UZyKbz6O9Q0q4haaXF0krOUclKmRJou/kKZYulgBHvHXPqOvg==" crossorigin="anonymous"></script>
  48. <?php
  49. endif;
  50. ?>
  51. <script type="text/javascript" data-cfasync="false" src="js/purify-2.2.7.js" integrity="sha512-7Ka1I/nJuR2CL8wzIS5PJS4HgEMd0HJ6kfAl6fFhwFBB27rhztFbe0tS+Ex+Qg+5n4nZIT4lty4k4Di3+X9T4A==" crossorigin="anonymous"></script>
  52. <script type="text/javascript" data-cfasync="false" src="js/legacy.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-LYos+qXHIRqFf5ZPNphvtTB0cgzHUizu2wwcOwcwz/VIpRv9lpcBgPYz4uq6jx0INwCAj6Fbnl5HoKiLufS2jg==" crossorigin="anonymous"></script>
  53. <script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-wuKnPu9+bTYhJ0HRhUmw0UxWYP5mbQehFNspkD9N4mTlxLkjRZXPnMt/nfT2/U62rRDUw1HL3SvveKJe2v4EBw==" crossorigin="anonymous"></script>
  54. <!-- icon -->
  55. <link rel="apple-touch-icon" href="img/apple-touch-icon.png?<?php echo rawurlencode($VERSION); ?>" sizes="180x180" />
  56. <link rel="icon" type="image/png" href="img/favicon-32x32.png?<?php echo rawurlencode($VERSION); ?>" sizes="32x32" />
  57. <link rel="icon" type="image/png" href="img/favicon-16x16.png?<?php echo rawurlencode($VERSION); ?>" sizes="16x16" />
  58. <link rel="manifest" href="manifest.json?<?php echo rawurlencode($VERSION); ?>" />
  59. <link rel="mask-icon" href="img/safari-pinned-tab.svg?<?php echo rawurlencode($VERSION); ?>" color="#ffcc00" />
  60. <link rel="shortcut icon" href="img/favicon.ico">
  61. <meta name="msapplication-config" content="browserconfig.xml">
  62. <meta name="theme-color" content="#ffe57e" />
  63. <!-- Twitter/social media cards -->
  64. <meta name="twitter:card" content="summary" />
  65. <meta name="twitter:title" content="<?php echo I18n::_('Encrypted note on PrivateBin') ?>" />
  66. <meta name="twitter:description" content="<?php echo I18n::_('Visit this link to see the note. Giving the URL to anyone allows them to access the note, too.') ?>" />
  67. <meta name="twitter:image" content="img/apple-touch-icon.png?<?php echo rawurlencode($VERSION); ?>" />
  68. <meta property="og:title" content="<?php echo I18n::_($NAME); ?>" />
  69. <meta property="og:site_name" content="<?php echo I18n::_($NAME); ?>" />
  70. <meta property="og:description" content="<?php echo I18n::_('Visit this link to see the note. Giving the URL to anyone allows them to access the note, too.') ?>" />
  71. <meta property="og:image" content="img/apple-touch-icon.png?<?php echo rawurlencode($VERSION); ?>" />
  72. <meta property="og:image:type" content="image/png" />
  73. <meta property="og:image:width" content="180" />
  74. <meta property="og:image:height" content="180" />
  75. </head>
  76. <body data-compression="<?php echo rawurlencode($COMPRESSION); ?>">
  77. <header>
  78. <div id="aboutbox">
  79. <?php echo sprintf(
  80. I18n::_('%s is a minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted %sin the browser%s using 256 bits AES.',
  81. I18n::_($NAME),
  82. '%s', '%s'
  83. ),
  84. '<i>', '</i>'), ' ', $INFO;
  85. ?>
  86. <br />
  87. <?php
  88. if (strlen($NOTICE)):
  89. ?>
  90. <span class="blink">▶</span> <?php echo I18n::encode($NOTICE);
  91. endif;
  92. ?>
  93. </div>
  94. <h1 class="title reloadlink"><?php echo I18n::_($NAME); ?></h1><br />
  95. <h2 class="title"><?php echo I18n::_('Because ignorance is bliss'); ?></h2><br />
  96. <h3 class="title"><?php echo $VERSION; ?></h3>
  97. <noscript><div id="noscript" class="nonworking"><?php echo I18n::_('JavaScript is required for %s to work. Sorry for the inconvenience.', I18n::_($NAME)); ?></div></noscript>
  98. <div id="oldnotice" class="nonworking hidden">
  99. <?php echo I18n::_('%s requires a modern browser to work.', I18n::_($NAME)), PHP_EOL; ?>
  100. <a href="https://www.mozilla.org/firefox/">Firefox</a>,
  101. <a href="https://www.opera.com/">Opera</a>,
  102. <a href="https://www.google.com/chrome">Chrome</a>…<br />
  103. <span class="small"><?php echo I18n::_('For more information <a href="%s">see this FAQ entry</a>.', 'https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-it-show-me-the-error-privatebin-requires-a-modern-browser-to-work'); ?></span>
  104. </div>
  105. <?php
  106. if ($HTTPWARNING):
  107. ?>
  108. <div id="httpnotice" class="errorMessage hidden">
  109. <?php echo I18n::_('This website is using an insecure connection! Please only use it for testing.'); ?><br />
  110. <span class="small"><?php echo I18n::_('For more information <a href="%s">see this FAQ entry</a>.', 'https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-it-show-me-an-error-about-an-insecure-connection'); ?></span>
  111. </div>
  112. <div id="insecurecontextnotice" class="errorMessage hidden">
  113. <?php echo I18n::_('Your browser may require an HTTPS connection to support the WebCrypto API. Try <a href="%s">switching to HTTPS</a>.', $HTTPSLINK); ?>
  114. </div>
  115. <?php
  116. endif;
  117. ?>
  118. </header>
  119. <section>
  120. <article>
  121. <div id="loadingindicator" class="hidden"><?php echo I18n::_('Loading…'); ?></div>
  122. <div id="status"><?php echo I18n::encode($STATUS); ?></div>
  123. <div id="errormessage" class="hidden"><?php echo I18n::encode($ERROR); ?></div>
  124. <div id="toolbar">
  125. <button id="newbutton" class="reloadlink hidden"><img src="img/icon_new.png" width="11" height="15" alt="" /><?php echo I18n::_('New'); ?></button>
  126. <button id="retrybutton" class="reloadlink hidden"><?php echo I18n::_('Retry'), PHP_EOL; ?></button>
  127. <button id="sendbutton" class="hidden"><img src="img/icon_send.png" width="18" height="15" alt="" /><?php echo I18n::_('Send'); ?></button>
  128. <button id="clonebutton" class="hidden"><img src="img/icon_clone.png" width="15" height="17" alt="" /><?php echo I18n::_('Clone'); ?></button>
  129. <button id="rawtextbutton" class="hidden"><img src="img/icon_raw.png" width="15" height="15" alt="" /><?php echo I18n::_('Raw text'); ?></button>
  130. <button id="emaillink" class="hidden"><img src="img/icon_email.png" width="15" height="15" alt="" /><?php echo I18n::_('Email'); ?></button>
  131. <?php
  132. if ($QRCODE):
  133. ?>
  134. <button id="qrcodelink" class="hidden"><img src="img/icon_qr.png" width="15" height="15" alt="" /><?php echo I18n::_('QR code'); ?></button>
  135. <?php
  136. endif;
  137. ?>
  138. <div id="expiration" class="hidden button"><?php echo I18n::_('Expires'); ?>:
  139. <select id="pasteExpiration" name="pasteExpiration">
  140. <?php
  141. foreach ($EXPIRE as $key => $value):
  142. ?>
  143. <option value="<?php echo $key; ?>"<?php
  144. if ($key == $EXPIREDEFAULT):
  145. ?> selected="selected"<?php
  146. endif;
  147. ?>><?php echo $value; ?></option>
  148. <?php
  149. endforeach;
  150. ?>
  151. </select>
  152. </div>
  153. <div id="remainingtime" class="hidden"></div>
  154. <div id="burnafterreadingoption" class="button hidden">
  155. <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
  156. if ($BURNAFTERREADINGSELECTED):
  157. ?> checked="checked"<?php
  158. endif;
  159. ?> />
  160. <label for="burnafterreading"><?php echo I18n::_('Burn after reading'); ?></label>
  161. </div>
  162. <?php
  163. if ($DISCUSSION):
  164. ?>
  165. <div id="opendiscussionoption" class="button hidden">
  166. <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
  167. if ($OPENDISCUSSION):
  168. ?> checked="checked"<?php
  169. endif;
  170. ?> />
  171. <label for="opendiscussion"><?php echo I18n::_('Open discussion'); ?></label>
  172. </div>
  173. <?php
  174. endif;
  175. if ($PASSWORD):
  176. ?>
  177. <div id="password" class="hidden">
  178. <input type="password" id="passwordinput" placeholder="<?php echo I18n::_('Password (recommended)'); ?>" size="32" />
  179. </div>
  180. <?php
  181. endif;
  182. ?>
  183. <div id="formatter" class="button hidden"><?php echo I18n::_('Format'); ?>:
  184. <select id="pasteFormatter" name="pasteFormatter">
  185. <?php
  186. foreach ($FORMATTER as $key => $value):
  187. ?>
  188. <option value="<?php echo $key; ?>"<?php
  189. if ($key == $FORMATTERDEFAULT):
  190. ?> selected="selected"<?php
  191. endif;
  192. ?>><?php echo $value; ?></option>
  193. <?php
  194. endforeach;
  195. ?>
  196. </select>
  197. </div>
  198. <?php
  199. if (strlen($LANGUAGESELECTION)):
  200. ?>
  201. <div id="language" class="button">
  202. <select name="lang">
  203. <?php
  204. foreach ($LANGUAGES as $key => $value):
  205. ?>
  206. <option data-lang="<?php echo $key; ?>" value="<?php echo $key; ?>"<?php
  207. if ($key == $LANGUAGESELECTION):
  208. ?> selected="selected"<?php
  209. endif;
  210. ?>><?php echo $value[0]; ?> (<?php echo $value[1]; ?>)</option>
  211. <?php
  212. endforeach;
  213. ?>
  214. </select>
  215. </div>
  216. <?php
  217. endif;
  218. ?>
  219. </div>
  220. <?php
  221. if ($QRCODE):
  222. ?>
  223. <div id="qrcode-display"></div>
  224. <?php
  225. endif;
  226. ?> <div id="pastesuccess" class="hidden">
  227. <div id="deletelink"></div>
  228. <div id="pastelink"></div>
  229. <?php
  230. if (strlen($URLSHORTENER)):
  231. ?>
  232. <button id="shortenbutton" data-shortener="<?php echo I18n::encode($URLSHORTENER); ?>"><img src="img/icon_shorten.png" width="13" height="15" /><?php echo I18n::_('Shorten URL'); ?></button>
  233. <?php
  234. endif;
  235. ?>
  236. </div>
  237. <?php
  238. if ($FILEUPLOAD):
  239. ?>
  240. <div id="attachment" class="hidden"><a><?php echo I18n::_('Download attachment'); ?></a></div>
  241. <div id="attach" class="hidden">
  242. <span id="clonedfile" class="hidden"><?php echo I18n::_('Cloned file attached.'); ?></span>
  243. <span id="filewrap"><?php echo I18n::_('Attach a file'); ?>: <input type="file" id="file" name="file" /></span>
  244. <span id="dragAndDropFileName" class="dragAndDropFile"><?php echo I18n::_('alternatively drag & drop a file or paste an image from the clipboard'); ?></span>
  245. <button id="fileremovebutton"><?php echo I18n::_('Remove attachment'); ?></button>
  246. </div>
  247. <?php
  248. endif;
  249. ?>
  250. <div id="preview" class="hidden">
  251. <button id="messageedit"><?php echo I18n::_('Editor'); ?></button>
  252. <button id="messagepreview"><?php echo I18n::_('Preview'); ?></button>
  253. </div>
  254. <div id="attachmentPreview" class="hidden"></div>
  255. <div id="prettymessage" class="hidden">
  256. <pre id="prettyprint" class="prettyprint linenums:1"></pre>
  257. </div>
  258. <div id="plaintext" class="hidden"></div>
  259. <textarea id="message" name="message" cols="80" rows="25" class="hidden"></textarea>
  260. </article>
  261. </section>
  262. <section>
  263. <div id="discussion" class="hidden">
  264. <h4 class="title"><?php echo I18n::_('Discussion'); ?></h4>
  265. <div id="commentcontainer"></div>
  266. </div>
  267. </section>
  268. <?php
  269. if ($DISCUSSION):
  270. ?>
  271. <div id="serverdata" class="hidden" aria-hidden="true">
  272. <div id="templates">
  273. <article id="commenttemplate" class="comment"><div class="commentmeta"><span class="nickname">name</span><span class="commentdate">0000-00-00</span></div><div class="commentdata">c</div><button class="btn btn-default btn-sm"><?php echo I18n::_('Reply'); ?></button></article>
  274. <div id="commenttailtemplate" class="comment"><button class="btn btn-default btn-sm"><?php echo I18n::_('Add comment'); ?></button></div>
  275. <div id="replytemplate" class="reply hidden"><input type="text" id="nickname" class="form-control" title="<?php echo I18n::_('Optional nickname…'); ?>" placeholder="<?php echo I18n::_('Optional nickname…'); ?>" /><textarea id="replymessage" class="replymessage form-control" cols="80" rows="7"></textarea><br /><div id="replystatus" role="alert" class="statusmessage hidden alert"><span class="glyphicon" aria-hidden="true"></span> </div><button id="replybutton" class="btn btn-default btn-sm"><?php echo I18n::_('Post comment'); ?></button></div>
  276. </div>
  277. </div>
  278. <?php
  279. endif;
  280. ?>
  281. <?php
  282. if ($FILEUPLOAD):
  283. ?>
  284. <div id="dropzone" class="hidden" tabindex="-1" aria-hidden="true"></div>
  285. <?php
  286. endif;
  287. ?>
  288. <section class="container">
  289. <div id="noscript" role="alert" class="nonworking alert alert-info noscript-hide"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true">
  290. <span> <?php echo I18n::_('Loading…'); ?></span><br>
  291. <span class="small"><?php echo I18n::_('In case this message never disappears please have a look at <a href="%s">this FAQ for information to troubleshoot</a>.', 'https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-the-loading-message-not-go-away'); ?></span>
  292. </div>
  293. </section>
  294. </body>
  295. </html>