page.php 12 KB

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