page.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <?php
  2. use PrivateBin\I18n;
  3. ?><!DOCTYPE html>
  4. <html lang="en">
  5. <head>
  6. <meta charset="utf-8" />
  7. <meta name="robots" content="noindex" />
  8. <meta name="referrer" content="no-referrer">
  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. <script type="text/javascript" data-cfasync="false" src="js/sjcl-1.0.8.js" integrity="sha512-J2eNenPwyfXkMVNMFz9Q54kKfYi5AA3mQWpNgtjSJzsKHtpbhUt/7bvcjGwwmzE8ZUVWMI/ndagIX1lG+SfxGA==" crossorigin="anonymous"></script>
  25. <?php
  26. if ($QRCODE):
  27. ?>
  28. <script async type="text/javascript" data-cfasync="false" src="js/kjua-0.6.0.js" integrity="sha512-GEEIHvphDt1NmaxzX8X1ZkBiGKXCv+Ofzwi8SMEH5wQVWqdGIvBO/fnxxKZ90RU1bVp6srS68nHIpZo6iVcG9g==" crossorigin="anonymous"></script>
  29. <?php
  30. endif;
  31. if ($ZEROBINCOMPATIBILITY):
  32. ?>
  33. <script type="text/javascript" data-cfasync="false" src="js/base64-1.7.js" integrity="sha512-JdwsSP3GyHR+jaCkns9CL9NTt4JUJqm/BsODGmYhBcj5EAPKcHYh+OiMfyHbcDLECe17TL0hjXADFkusAqiYgA==" crossorigin="anonymous"></script>
  34. <?php
  35. else:
  36. ?>
  37. <script type="text/javascript" data-cfasync="false" src="js/base64-2.4.5.js" integrity="sha512-YINE6agO8ZrYuzlrZZwQJTu0uqURJDxD4gjsfZ6mV4fP2gW5j8giNJ734iyJVTBrnF2XMiUBM/DSi7ON1V5RMQ==" crossorigin="anonymous"></script>
  38. <?php
  39. endif;
  40. ?>
  41. <script type="text/javascript" data-cfasync="false" src="js/rawdeflate-0.5.js" integrity="sha512-tTdZ7qMr7tt5VQy4iCHu6/aGB12eRwbUy+AEI5rXntfsjcRfBeeqJloMsBU9FrGk1bIYLiuND/FhU42LO1bi0g==" crossorigin="anonymous"></script>
  42. <script type="text/javascript" data-cfasync="false" src="js/rawinflate-0.3.js" integrity="sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==" crossorigin="anonymous"></script>
  43. <?php
  44. if ($SYNTAXHIGHLIGHTING):
  45. ?>
  46. <script type="text/javascript" data-cfasync="false" src="js/prettify.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==" crossorigin="anonymous"></script>
  47. <?php
  48. endif;
  49. if ($MARKDOWN):
  50. ?>
  51. <script type="text/javascript" data-cfasync="false" src="js/showdown-1.9.1.js" integrity="sha512-nRri7kqh3iRLdHbhtjfe8w9eAQPmt+ubH5U88UZyKbz6O9Q0q4haaXF0krOUclKmRJou/kKZYulgBHvHXPqOvg==" crossorigin="anonymous"></script>
  52. <?php
  53. endif;
  54. ?>
  55. <script type="text/javascript" data-cfasync="false" src="js/purify-2.0.7.js" integrity="sha512-XjNEK1xwh7SJ/7FouwV4VZcGW9cMySL3SwNpXgrURLBcXXQYtZdqhGoNdEwx9vwLvFjUGDQVNgpOrTsXlSTiQg==" crossorigin="anonymous"></script>
  56. <script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-XauVNDkk7v8lwDf2WmHWzloKuejJKJpfEvjBBf4bJV45VRP2SX6tg7ngNhmywIay8vNgoFhVBZZoe3y9tEio8Q==" crossorigin="anonymous"></script>
  57. <!--[if lt IE 10]>
  58. <style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
  59. <![endif]-->
  60. <link rel="apple-touch-icon" href="img/apple-touch-icon.png?<?php echo rawurlencode($VERSION); ?>" sizes="180x180" />
  61. <link rel="icon" type="image/png" href="img/favicon-32x32.png?<?php echo rawurlencode($VERSION); ?>" sizes="32x32" />
  62. <link rel="icon" type="image/png" href="img/favicon-16x16.png?<?php echo rawurlencode($VERSION); ?>" sizes="16x16" />
  63. <link rel="manifest" href="manifest.json?<?php echo rawurlencode($VERSION); ?>" />
  64. <link rel="mask-icon" href="img/safari-pinned-tab.svg?<?php echo rawurlencode($VERSION); ?>" color="#ffcc00" />
  65. <link rel="shortcut icon" href="img/favicon.ico">
  66. <meta name="msapplication-config" content="browserconfig.xml">
  67. <meta name="theme-color" content="#ffe57e" />
  68. </head>
  69. <body>
  70. <header>
  71. <div id="aboutbox">
  72. <?php echo I18n::_('%s is a minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted <i>in the browser</i> using 256 bits AES. More information on the <a href="https://privatebin.info/">project page</a>.', I18n::_($NAME)); ?><br />
  73. <?php
  74. if (strlen($NOTICE)):
  75. ?>
  76. <span class="blink">▶</span> <?php echo htmlspecialchars($NOTICE);
  77. endif;
  78. ?>
  79. </div>
  80. <h1 class="title reloadlink"><?php echo I18n::_($NAME); ?></h1><br />
  81. <h2 class="title"><?php echo I18n::_('Because ignorance is bliss'); ?></h2><br />
  82. <h3 class="title"><?php echo $VERSION; ?></h3>
  83. <noscript><div id="noscript" class="nonworking"><?php echo I18n::_('JavaScript is required for %s to work.<br />Sorry for the inconvenience.', I18n::_($NAME)); ?></div></noscript>
  84. <div id="oldienotice" class="nonworking"><?php echo I18n::_('%s requires a modern browser to work.', I18n::_($NAME)); ?></div>
  85. <div id="ienotice"><?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'), PHP_EOL; ?>
  86. <a href="https://www.mozilla.org/firefox/">Firefox</a>,
  87. <a href="https://www.opera.com/">Opera</a>,
  88. <a href="https://www.google.com/chrome">Chrome</a>…
  89. </div>
  90. </header>
  91. <section>
  92. <article>
  93. <div id="loadingindicator" class="hidden"><?php echo I18n::_('Loading…'); ?></div>
  94. <div id="status"><?php echo htmlspecialchars($STATUS); ?></div>
  95. <div id="errormessage" class="hidden"><?php echo htmlspecialchars($ERROR); ?></div>
  96. <div id="toolbar">
  97. <button id="newbutton" class="reloadlink hidden"><img src="img/icon_new.png" width="11" height="15" alt="" /><?php echo I18n::_('New'); ?></button>
  98. <button id="retrybutton" class="reloadlink hidden"><?php echo I18n::_('Retry'), PHP_EOL; ?></button>
  99. <button id="sendbutton" class="hidden"><img src="img/icon_send.png" width="18" height="15" alt="" /><?php echo I18n::_('Send'); ?></button>
  100. <button id="clonebutton" class="hidden"><img src="img/icon_clone.png" width="15" height="17" alt="" /><?php echo I18n::_('Clone'); ?></button>
  101. <button id="rawtextbutton" class="hidden"><img src="img/icon_raw.png" width="15" height="15" alt="" /><?php echo I18n::_('Raw text'); ?></button>
  102. <?php
  103. if ($QRCODE):
  104. ?>
  105. <button id="qrcodelink" class="hidden"><img src="img/icon_qr.png" width="15" height="15" alt="" /><?php echo I18n::_('QR code'); ?></button>
  106. <?php
  107. endif;
  108. ?>
  109. <div id="expiration" class="hidden button"><?php echo I18n::_('Expires'); ?>:
  110. <select id="pasteExpiration" name="pasteExpiration">
  111. <?php
  112. foreach ($EXPIRE as $key => $value):
  113. ?>
  114. <option value="<?php echo $key; ?>"<?php
  115. if ($key == $EXPIREDEFAULT):
  116. ?> selected="selected"<?php
  117. endif;
  118. ?>><?php echo $value; ?></option>
  119. <?php
  120. endforeach;
  121. ?>
  122. </select>
  123. </div>
  124. <div id="remainingtime" class="hidden"></div>
  125. <div id="burnafterreadingoption" class="button hidden">
  126. <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
  127. if ($BURNAFTERREADINGSELECTED):
  128. ?> checked="checked"<?php
  129. endif;
  130. ?> />
  131. <label for="burnafterreading"><?php echo I18n::_('Burn after reading'); ?></label>
  132. </div>
  133. <?php
  134. if ($DISCUSSION):
  135. ?>
  136. <div id="opendiscussionoption" class="button hidden">
  137. <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
  138. if ($OPENDISCUSSION):
  139. ?> checked="checked"<?php
  140. endif;
  141. ?> />
  142. <label for="opendiscussion"><?php echo I18n::_('Open discussion'); ?></label>
  143. </div>
  144. <?php
  145. endif;
  146. if ($PASSWORD):
  147. ?>
  148. <div id="password" class="hidden">
  149. <input type="password" id="passwordinput" placeholder="<?php echo I18n::_('Password (recommended)'); ?>" size="32" />
  150. </div>
  151. <?php
  152. endif;
  153. ?>
  154. <div id="formatter" class="button hidden"><?php echo I18n::_('Format'); ?>:
  155. <select id="pasteFormatter" name="pasteFormatter">
  156. <?php
  157. foreach ($FORMATTER as $key => $value):
  158. ?>
  159. <option value="<?php echo $key; ?>"<?php
  160. if ($key == $FORMATTERDEFAULT):
  161. ?> selected="selected"<?php
  162. endif;
  163. ?>><?php echo $value; ?></option>
  164. <?php
  165. endforeach;
  166. ?>
  167. </select>
  168. </div>
  169. <?php
  170. if (strlen($LANGUAGESELECTION)):
  171. ?>
  172. <div id="language" class="button">
  173. <select name="lang">
  174. <?php
  175. foreach ($LANGUAGES as $key => $value):
  176. ?>
  177. <option data-lang="<?php echo $key; ?>" value="<?php echo $key; ?>"<?php
  178. if ($key == $LANGUAGESELECTION):
  179. ?> selected="selected"<?php
  180. endif;
  181. ?>><?php echo $value[0]; ?> (<?php echo $value[1]; ?>)</option>
  182. <?php
  183. endforeach;
  184. ?>
  185. </select>
  186. </div>
  187. <?php
  188. endif;
  189. ?>
  190. </div>
  191. <?php
  192. if ($QRCODE):
  193. ?>
  194. <div id="qrcode-display"></div>
  195. <?php
  196. endif;
  197. ?> <div id="pastesuccess" class="hidden">
  198. <div id="deletelink"></div>
  199. <div id="pastelink"></div>
  200. <?php
  201. if (strlen($URLSHORTENER)):
  202. ?>
  203. <button id="shortenbutton" data-shortener="<?php echo htmlspecialchars($URLSHORTENER); ?>"><img src="img/icon_shorten.png" width="13" height="15" /><?php echo I18n::_('Shorten URL'); ?></button>
  204. <?php
  205. endif;
  206. ?>
  207. </div>
  208. <?php
  209. if ($FILEUPLOAD):
  210. ?>
  211. <div id="attachment" class="hidden"><a><?php echo I18n::_('Download attachment'); ?></a></div>
  212. <div id="attach" class="hidden">
  213. <span id="clonedfile" class="hidden"><?php echo I18n::_('Cloned file attached.'); ?></span>
  214. <span id="filewrap"><?php echo I18n::_('Attach a file'); ?>: <input type="file" id="file" name="file" /></span>
  215. <span id="dragAndDropFileName" class="dragAndDropFile"><?php echo I18n::_('alternatively drag & drop a file or paste an image from the clipboard'); ?></span>
  216. <button id="fileremovebutton"><?php echo I18n::_('Remove attachment'); ?></button>
  217. </div>
  218. <?php
  219. endif;
  220. ?>
  221. <div id="preview" class="hidden">
  222. <button id="messageedit"><?php echo I18n::_('Editor'); ?></button>
  223. <button id="messagepreview"><?php echo I18n::_('Preview'); ?></button>
  224. </div>
  225. <div id="attachmentPreview" class="hidden"></div>
  226. <div id="prettymessage" class="hidden">
  227. <pre id="prettyprint" class="prettyprint linenums:1"></pre>
  228. </div>
  229. <div id="plaintext" class="hidden"></div>
  230. <textarea id="message" name="message" cols="80" rows="25" class="hidden"></textarea>
  231. </article>
  232. </section>
  233. <section>
  234. <div id="discussion" class="hidden">
  235. <h4 class="title"><?php echo I18n::_('Discussion'); ?></h4>
  236. <div id="commentcontainer"></div>
  237. </div>
  238. </section>
  239. <?php
  240. if ($DISCUSSION):
  241. ?>
  242. <div id="serverdata" class="hidden" aria-hidden="true">
  243. <div id="templates">
  244. <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>
  245. <div id="commenttailtemplate" class="comment"><button class="btn btn-default btn-sm"><?php echo I18n::_('Add comment'); ?></button></div>
  246. <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>
  247. </div>
  248. </div>
  249. <?php
  250. endif;
  251. ?>
  252. <section class="container">
  253. <div id="noscript" role="alert" class="nonworking alert alert-info noscript-hide"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true">
  254. <span> <?php echo I18n::_('Loading…'); ?></span><br>
  255. <span class="small"><?php echo I18n::_('In case this message never disappears please have a look at <a href="https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-not-the-loading-message-go-away">this FAQ for information to troubleshoot</a>.'); ?></span>
  256. </div>
  257. </section>
  258. </body>
  259. </html>