page.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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. <meta name="google" content="notranslate">
  10. <title><?php echo I18n::_($NAME); ?></title>
  11. <link type="text/css" rel="stylesheet" href="css/privatebin.css?<?php echo rawurlencode($VERSION); ?>" />
  12. <?php
  13. if ($SYNTAXHIGHLIGHTING):
  14. ?>
  15. <link type="text/css" rel="stylesheet" href="css/prettify/prettify.css?<?php echo rawurlencode($VERSION); ?>" />
  16. <?php
  17. if (strlen($SYNTAXHIGHLIGHTINGTHEME)):
  18. ?>
  19. <link type="text/css" rel="stylesheet" href="css/prettify/<?php echo rawurlencode($SYNTAXHIGHLIGHTINGTHEME); ?>.css?<?php echo rawurlencode($VERSION); ?>" />
  20. <?php
  21. endif;
  22. endif;
  23. ?>
  24. <script type="text/javascript" data-cfasync="false" src="js/jquery-3.4.1.js" integrity="sha512-bnIvzh6FU75ZKxp0GXLH9bewza/OIw6dLVh9ICg0gogclmYGguQJWl8U30WpbsGTqbIiAwxTsbe76DErLq5EDQ==" 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. endif;
  36. ?>
  37. <script type="text/javascript" data-cfasync="false" src="js/zlib-1.2.11.js" integrity="sha512-Yey/0yoaVmSbqMEyyff3DIu8kCPwpHvHf7tY1AuZ1lrX9NPCMg87PwzngMi+VNbe4ilCApmePeuKT869RTcyCQ==" crossorigin="anonymous"></script>
  38. <script type="text/javascript" data-cfasync="false" src="js/base-x-3.0.5.1.js" integrity="sha512-/zL3MWKMtl1IBF0URx3laql2jUw+rWfFFabNlILY/Qm+hUsQR/XULjUyNHkW/FkrV7A0sMQ7tsppH7sj5ht8wA==" crossorigin="anonymous"></script>
  39. <script type="text/javascript" data-cfasync="false" src="js/rawinflate-0.3.js" integrity="sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==" crossorigin="anonymous"></script>
  40. <?php
  41. if ($SYNTAXHIGHLIGHTING):
  42. ?>
  43. <script type="text/javascript" data-cfasync="false" src="js/prettify.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==" crossorigin="anonymous"></script>
  44. <?php
  45. endif;
  46. if ($MARKDOWN):
  47. ?>
  48. <script type="text/javascript" data-cfasync="false" src="js/showdown-1.9.0.js" integrity="sha512-Kv8oAge9h2QmRyzb52jUomyXAvSMrpE9kWF3QRMFajo1a/TXjtY8u71vUA6t4+LE7huz4TSVH8VLJBEmcZiPRA==" crossorigin="anonymous"></script>
  49. <?php
  50. endif;
  51. ?>
  52. <script type="text/javascript" data-cfasync="false" src="js/purify-1.0.10.js" integrity="sha512-CqskSFXERL38A1PJP9BlO04me7kmwgDIhN1+k24RoFiisEwXA0BMdm0lzJC7g5jCRZ4k5OYdOJGEqW9CwDl4CA==" crossorigin="anonymous"></script>
  53. <script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-nuGweMxu6IG9HcczL7tf6dhR2vGKVaYuv7yC7ap+WsUnI6TMrdyQiT1dZG/k9JvnvW+ptJ+bFkuHpgec1gZ/DA==" crossorigin="anonymous"></script>
  54. <!--[if IE]>
  55. <style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style>
  56. <![endif]-->
  57. <link rel="apple-touch-icon" href="img/apple-touch-icon.png?<?php echo rawurlencode($VERSION); ?>" sizes="180x180" />
  58. <link rel="icon" type="image/png" href="img/favicon-32x32.png?<?php echo rawurlencode($VERSION); ?>" sizes="32x32" />
  59. <link rel="icon" type="image/png" href="img/favicon-16x16.png?<?php echo rawurlencode($VERSION); ?>" sizes="16x16" />
  60. <link rel="manifest" href="manifest.json?<?php echo rawurlencode($VERSION); ?>" />
  61. <link rel="mask-icon" href="img/safari-pinned-tab.svg?<?php echo rawurlencode($VERSION); ?>" color="#ffcc00" />
  62. <link rel="shortcut icon" href="img/favicon.ico">
  63. <meta name="msapplication-config" content="browserconfig.xml">
  64. <meta name="theme-color" content="#ffe57e" />
  65. </head>
  66. <body>
  67. <header>
  68. <div id="aboutbox">
  69. <?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 />
  70. <?php
  71. if (strlen($NOTICE)):
  72. ?>
  73. <span class="blink">▶</span> <?php echo htmlspecialchars($NOTICE);
  74. endif;
  75. ?>
  76. </div>
  77. <h1 class="title reloadlink"><?php echo I18n::_($NAME); ?></h1><br />
  78. <h2 class="title"><?php echo I18n::_('Because ignorance is bliss'); ?></h2><br />
  79. <h3 class="title"><?php echo $VERSION; ?></h3>
  80. <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>
  81. <div id="oldnotice" class="nonworking"><?php echo I18n::_('%s requires a modern browser to work.', I18n::_($NAME)); ?></div>
  82. <div id="ienotice" class="nonworking"><?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'), PHP_EOL; ?>
  83. <a href="https://www.mozilla.org/firefox/">Firefox</a>,
  84. <a href="https://www.opera.com/">Opera</a>,
  85. <a href="https://www.google.com/chrome">Chrome</a>…
  86. </div>
  87. <?php
  88. if ($HTTPWARNING):
  89. ?>
  90. <div id="httpnotice" class="errorMessage"><?php echo I18n::_('This website is using an insecure HTTP connection! Please use it only for testing.'); ?></div>
  91. <?php
  92. endif;
  93. ?>
  94. </header>
  95. <section>
  96. <article>
  97. <div id="loadingindicator" class="hidden"><?php echo I18n::_('Loading…'); ?></div>
  98. <div id="status"><?php echo htmlspecialchars($STATUS); ?></div>
  99. <div id="errormessage" class="hidden"><?php echo htmlspecialchars($ERROR); ?></div>
  100. <div id="toolbar">
  101. <button id="newbutton" class="reloadlink hidden"><img src="img/icon_new.png" width="11" height="15" alt="" /><?php echo I18n::_('New'); ?></button>
  102. <button id="retrybutton" class="reloadlink hidden"><?php echo I18n::_('Retry'), PHP_EOL; ?></button>
  103. <button id="sendbutton" class="hidden"><img src="img/icon_send.png" width="18" height="15" alt="" /><?php echo I18n::_('Send'); ?></button>
  104. <button id="clonebutton" class="hidden"><img src="img/icon_clone.png" width="15" height="17" alt="" /><?php echo I18n::_('Clone'); ?></button>
  105. <button id="rawtextbutton" class="hidden"><img src="img/icon_raw.png" width="15" height="15" alt="" /><?php echo I18n::_('Raw text'); ?></button>
  106. <?php
  107. if ($QRCODE):
  108. ?>
  109. <button id="qrcodelink" class="hidden"><img src="img/icon_qr.png" width="15" height="15" alt="" /><?php echo I18n::_('QR code'); ?></button>
  110. <?php
  111. endif;
  112. ?>
  113. <div id="expiration" class="hidden button"><?php echo I18n::_('Expires'); ?>:
  114. <select id="pasteExpiration" name="pasteExpiration">
  115. <?php
  116. foreach ($EXPIRE as $key => $value):
  117. ?>
  118. <option value="<?php echo $key; ?>"<?php
  119. if ($key == $EXPIREDEFAULT):
  120. ?> selected="selected"<?php
  121. endif;
  122. ?>><?php echo $value; ?></option>
  123. <?php
  124. endforeach;
  125. ?>
  126. </select>
  127. </div>
  128. <div id="remainingtime" class="hidden"></div>
  129. <div id="burnafterreadingoption" class="button hidden">
  130. <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
  131. if ($BURNAFTERREADINGSELECTED):
  132. ?> checked="checked"<?php
  133. endif;
  134. ?> />
  135. <label for="burnafterreading"><?php echo I18n::_('Burn after reading'); ?></label>
  136. </div>
  137. <?php
  138. if ($DISCUSSION):
  139. ?>
  140. <div id="opendiscussionoption" class="button hidden">
  141. <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
  142. if ($OPENDISCUSSION):
  143. ?> checked="checked"<?php
  144. endif;
  145. ?> />
  146. <label for="opendiscussion"><?php echo I18n::_('Open discussion'); ?></label>
  147. </div>
  148. <?php
  149. endif;
  150. if ($PASSWORD):
  151. ?>
  152. <div id="password" class="hidden">
  153. <input type="password" id="passwordinput" placeholder="<?php echo I18n::_('Password (recommended)'); ?>" size="32" />
  154. </div>
  155. <?php
  156. endif;
  157. ?>
  158. <div id="formatter" class="button hidden"><?php echo I18n::_('Format'); ?>:
  159. <select id="pasteFormatter" name="pasteFormatter">
  160. <?php
  161. foreach ($FORMATTER as $key => $value):
  162. ?>
  163. <option value="<?php echo $key; ?>"<?php
  164. if ($key == $FORMATTERDEFAULT):
  165. ?> selected="selected"<?php
  166. endif;
  167. ?>><?php echo $value; ?></option>
  168. <?php
  169. endforeach;
  170. ?>
  171. </select>
  172. </div>
  173. <?php
  174. if (strlen($LANGUAGESELECTION)):
  175. ?>
  176. <div id="language" class="button">
  177. <select name="lang">
  178. <?php
  179. foreach ($LANGUAGES as $key => $value):
  180. ?>
  181. <option data-lang="<?php echo $key; ?>" value="<?php echo $key; ?>"<?php
  182. if ($key == $LANGUAGESELECTION):
  183. ?> selected="selected"<?php
  184. endif;
  185. ?>><?php echo $value[0]; ?> (<?php echo $value[1]; ?>)</option>
  186. <?php
  187. endforeach;
  188. ?>
  189. </select>
  190. </div>
  191. <?php
  192. endif;
  193. ?>
  194. </div>
  195. <?php
  196. if ($QRCODE):
  197. ?>
  198. <div id="qrcode-display"></div>
  199. <?php
  200. endif;
  201. ?> <div id="pastesuccess" class="hidden">
  202. <div id="deletelink"></div>
  203. <div id="pastelink"></div>
  204. <?php
  205. if (strlen($URLSHORTENER)):
  206. ?>
  207. <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>
  208. <?php
  209. endif;
  210. ?>
  211. </div>
  212. <?php
  213. if ($FILEUPLOAD):
  214. ?>
  215. <div id="attachment" class="hidden"><a><?php echo I18n::_('Download attachment'); ?></a></div>
  216. <div id="attach" class="hidden">
  217. <span id="clonedfile" class="hidden"><?php echo I18n::_('Cloned file attached.'); ?></span>
  218. <span id="filewrap"><?php echo I18n::_('Attach a file'); ?>: <input type="file" id="file" name="file" /></span>
  219. <span id="dragAndDropFileName" class="dragAndDropFile"><?php echo I18n::_('alternatively drag & drop a file or paste an image from the clipboard'); ?></span>
  220. <button id="fileremovebutton"><?php echo I18n::_('Remove attachment'); ?></button>
  221. </div>
  222. <?php
  223. endif;
  224. ?>
  225. <div id="preview" class="hidden">
  226. <button id="messageedit"><?php echo I18n::_('Editor'); ?></button>
  227. <button id="messagepreview"><?php echo I18n::_('Preview'); ?></button>
  228. </div>
  229. <div id="attachmentPreview" class="hidden"></div>
  230. <div id="prettymessage" class="hidden">
  231. <pre id="prettyprint" class="prettyprint linenums:1"></pre>
  232. </div>
  233. <div id="plaintext" class="hidden"></div>
  234. <textarea id="message" name="message" cols="80" rows="25" class="hidden"></textarea>
  235. </article>
  236. </section>
  237. <section>
  238. <div id="discussion" class="hidden">
  239. <h4 class="title"><?php echo I18n::_('Discussion'); ?></h4>
  240. <div id="commentcontainer"></div>
  241. </div>
  242. </section>
  243. <?php
  244. if ($DISCUSSION):
  245. ?>
  246. <div id="serverdata" class="hidden" aria-hidden="true">
  247. <div id="templates">
  248. <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>
  249. <div id="commenttailtemplate" class="comment"><button class="btn btn-default btn-sm"><?php echo I18n::_('Add comment'); ?></button></div>
  250. <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>
  251. </div>
  252. </div>
  253. <?php
  254. endif;
  255. ?>
  256. <section class="container">
  257. <div id="noscript" role="alert" class="nonworking alert alert-info noscript-hide"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true">
  258. <span> <?php echo I18n::_('Loading…'); ?></span><br>
  259. <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>
  260. </div>
  261. </section>
  262. </body>
  263. </html>