page.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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" src="js/jquery-3.1.1.js" integrity="sha512-U6K1YLIFUWcvuw5ucmMtT9HH4t0uz3M366qrF5y4vnyH6dgDzndlcGvH/Lz5k8NFh80SN95aJ5rqGZEdaQZ7ZQ==" crossorigin="anonymous"></script>
  24. <script type="text/javascript" src="js/sjcl-1.0.6.js" integrity="sha512-DsyxLV/uBoQlRTJmW5Gb2SxXUXB+aYeZ6zk+NuXy8LuLyi8oGti9AGn6He5fUY2DtgQ2//RjfaZog8exFuunUQ==" crossorigin="anonymous"></script>
  25. <?php
  26. if ($ZEROBINCOMPATIBILITY):
  27. ?>
  28. <script type="text/javascript" src="js/base64-1.7.js" integrity="sha512-JdwsSP3GyHR+jaCkns9CL9NTt4JUJqm/BsODGmYhBcj5EAPKcHYh+OiMfyHbcDLECe17TL0hjXADFkusAqiYgA==" crossorigin="anonymous"></script>
  29. <?php
  30. else:
  31. ?>
  32. <script type="text/javascript" src="js/base64-2.1.9.js" integrity="sha512-rbqAby7hObftbEoGQzkhUbEh5YkUn2MtekTLs4btvo2oly4CZ3DxhJzEh0u/rNzS54tcJdqi5Ug1ruugEd2U1g==" crossorigin="anonymous"></script>
  33. <?php
  34. endif;
  35. ?>
  36. <script type="text/javascript" src="js/rawdeflate-0.5.js" integrity="sha512-tTdZ7qMr7tt5VQy4iCHu6/aGB12eRwbUy+AEI5rXntfsjcRfBeeqJloMsBU9FrGk1bIYLiuND/FhU42LO1bi0g==" crossorigin="anonymous"></script>
  37. <script type="text/javascript" src="js/rawinflate-0.3.js" integrity="sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==" crossorigin="anonymous"></script>
  38. <?php
  39. if ($SYNTAXHIGHLIGHTING):
  40. ?>
  41. <script type="text/javascript" src="js/prettify.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-m8iHxoN+Fe12xxFwWNdY/TS4KoFntHp29qY0xUzBnPd0bkKMOR/dFhEdTWydpt0b/fIXyhB+znGYUvgjfJ2RzQ==" crossorigin="anonymous"></script>
  42. <?php
  43. endif;
  44. if ($MARKDOWN):
  45. ?>
  46. <script type="text/javascript" src="js/showdown-1.6.1.js" integrity="sha512-e6kAsBTgFnTBnEQXrq8BV6+XFwxb3kyWHeEPOl+KhxaWt3xImE2zAW2+yP3E2CQ7F9yoJl1poVU9qxkOEtVsTQ==" crossorigin="anonymous"></script>
  47. <script type="text/javascript" src="js/purify.min.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-jJuy143F5Oy7oS3VkjzeJGBxIUuQ1H0eSjuvLGD3FiQzeu8Pwp5vI/jQ2dxlxSrzejmNMicdLHnIqH7R8Ft0lQ==" crossorigin="anonymous"></script>
  48. <?php
  49. endif;
  50. ?>
  51. <script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-CbxrV468ako77cl5jNqoqohA9EphJI54ha7/3Zv0K7lXW/0fC7l1L+SXpTq94FpQP4vSIZFmQnOkrmPxkgNbag==" crossorigin="anonymous"></script>
  52. <!--[if lt IE 10]>
  53. <style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
  54. <![endif]-->
  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. </head>
  64. <body>
  65. <header>
  66. <div id="aboutbox">
  67. <?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 />
  68. <?php
  69. if (strlen($NOTICE)):
  70. ?>
  71. <span class="blink">▶</span> <?php echo htmlspecialchars($NOTICE);
  72. endif;
  73. ?>
  74. </div>
  75. <h1 class="title reloadlink"><?php echo I18n::_($NAME); ?></h1><br />
  76. <h2 class="title"><?php echo I18n::_('Because ignorance is bliss'); ?></h2><br />
  77. <h3 class="title"><?php echo $VERSION; ?></h3>
  78. <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>
  79. <div id="oldienotice" class="nonworking"><?php echo I18n::_('%s requires a modern browser to work.', I18n::_($NAME)); ?></div>
  80. <div id="ienotice"><?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'), PHP_EOL; ?>
  81. <a href="https://www.mozilla.org/firefox/">Firefox</a>,
  82. <a href="https://www.opera.com/">Opera</a>,
  83. <a href="https://www.google.com/chrome">Chrome</a>…
  84. </div>
  85. </header>
  86. <section>
  87. <article>
  88. <div id="loadingindicator" class="hidden"><?php echo I18n::_('Loading…'); ?></div>
  89. <div id="status"><?php echo htmlspecialchars($STATUS); ?></div>
  90. <div id="errormessage" class="hidden"><?php echo htmlspecialchars($ERROR); ?></div>
  91. <div id="toolbar">
  92. <button id="newbutton" class="reloadlink hidden"><img src="img/icon_new.png" width="11" height="15" alt="" /><?php echo I18n::_('New'); ?></button>
  93. <button id="sendbutton" class="hidden"><img src="img/icon_send.png" width="18" height="15" alt="" /><?php echo I18n::_('Send'); ?></button>
  94. <?php
  95. if ($EXPIRECLONE):
  96. ?>
  97. <button id="clonebutton" class="hidden"><img src="img/icon_clone.png" width="15" height="17" alt="" /><?php echo I18n::_('Clone'); ?></button>
  98. <?php
  99. endif;
  100. ?>
  101. <button id="rawtextbutton" class="hidden"><img src="img/icon_raw.png" width="15" height="15" alt="" /><?php echo I18n::_('Raw text'); ?></button>
  102. <div id="expiration" class="hidden button"><?php echo I18n::_('Expires'); ?>:
  103. <select id="pasteExpiration" name="pasteExpiration">
  104. <?php
  105. foreach ($EXPIRE as $key => $value):
  106. ?>
  107. <option value="<?php echo $key; ?>"<?php
  108. if ($key == $EXPIREDEFAULT):
  109. ?> selected="selected"<?php
  110. endif;
  111. ?>><?php echo $value; ?></option>
  112. <?php
  113. endforeach;
  114. ?>
  115. </select>
  116. </div>
  117. <div id="remainingtime" class="hidden"></div>
  118. <div id="burnafterreadingoption" class="button hidden">
  119. <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
  120. if ($BURNAFTERREADINGSELECTED):
  121. ?> checked="checked"<?php
  122. endif;
  123. ?> />
  124. <label for="burnafterreading"><?php echo I18n::_('Burn after reading'); ?></label>
  125. </div>
  126. <?php
  127. if ($DISCUSSION):
  128. ?>
  129. <div id="opendiscussionoption" class="button hidden">
  130. <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
  131. if ($OPENDISCUSSION):
  132. ?> checked="checked"<?php
  133. endif;
  134. ?> />
  135. <label for="opendiscussion" <?php
  136. if (!$OPENDISCUSSION):
  137. ?> style="color: #BBBBBB;"<?php
  138. endif;
  139. ?>><?php echo I18n::_('Open discussion'); ?></label>
  140. </div>
  141. <?php
  142. endif;
  143. if ($PASSWORD):
  144. ?>
  145. <div id="password" class="hidden">
  146. <input type="password" id="passwordinput" placeholder="<?php echo I18n::_('Password (recommended)'); ?>" size="32" />
  147. </div>
  148. <?php
  149. endif;
  150. ?>
  151. <div id="formatter" class="button hidden"><?php echo I18n::_('Format'); ?>:
  152. <select id="pasteFormatter" name="pasteFormatter">
  153. <?php
  154. foreach ($FORMATTER as $key => $value):
  155. ?>
  156. <option value="<?php echo $key; ?>"<?php
  157. if ($key == $FORMATTERDEFAULT):
  158. ?> selected="selected"<?php
  159. endif;
  160. ?>><?php echo $value; ?></option>
  161. <?php
  162. endforeach;
  163. ?>
  164. </select>
  165. </div>
  166. <?php
  167. if (strlen($LANGUAGESELECTION)):
  168. ?>
  169. <div id="language" class="button">
  170. <select name="lang">
  171. <?php
  172. foreach ($LANGUAGES as $key => $value):
  173. ?>
  174. <option data-lang="<?php echo $key; ?>" value="<?php echo $key; ?>"<?php
  175. if ($key == $LANGUAGESELECTION):
  176. ?> selected="selected"<?php
  177. endif;
  178. ?>><?php echo $value[0]; ?> (<?php echo $value[1]; ?>)</option>
  179. <?php
  180. endforeach;
  181. ?>
  182. </select>
  183. </div>
  184. <?php
  185. endif;
  186. ?>
  187. </div>
  188. <div id="pasteresult" class="hidden">
  189. <div id="deletelink"></div>
  190. <div id="pastelink">
  191. <?php
  192. if (strlen($URLSHORTENER)):
  193. ?>
  194. <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>
  195. <?php
  196. endif;
  197. ?>
  198. </div>
  199. </div>
  200. <?php
  201. if ($FILEUPLOAD):
  202. ?>
  203. <div id="attachment" class="hidden"><a><?php echo I18n::_('Download attachment'); ?></a></div>
  204. <div id="attach" class="hidden">
  205. <span id="clonedfile" class="hidden"><?php echo I18n::_('Cloned file attached.'); ?></span>
  206. <span id="filewrap"><?php echo I18n::_('Attach a file'); ?>: <input type="file" id="file" name="file" /></span>
  207. <button id="fileremovebutton"><?php echo I18n::_('Remove attachment'); ?></button>
  208. </div>
  209. <?php
  210. endif;
  211. ?>
  212. <div id="preview" class="hidden">
  213. <button id="messageedit"><?php echo I18n::_('Editor'); ?></button>
  214. <button id="messagepreview"><?php echo I18n::_('Preview'); ?></button>
  215. </div>
  216. <div id="image" class="hidden"></div>
  217. <div id="prettymessage" class="hidden">
  218. <pre id="prettyprint" class="prettyprint linenums:1"></pre>
  219. </div>
  220. <div id="plaintext" class="hidden"></div>
  221. <textarea id="message" name="message" cols="80" rows="25" class="hidden"></textarea>
  222. </article>
  223. </section>
  224. <section>
  225. <div id="discussion" class="hidden">
  226. <h4 class="title"><?php echo I18n::_('Discussion'); ?></h4>
  227. <div id="commentcontainer"></div>
  228. </div>
  229. </section>
  230. <div id="serverdata" class="hidden" aria-hidden="true">
  231. <div id="cipherdata" class="hidden"><?php echo htmlspecialchars($CIPHERDATA, ENT_NOQUOTES); ?></div>
  232. <?php
  233. if ($DISCUSSION):
  234. ?>
  235. <div id="templates">
  236. <!-- @TODO: when I intend/structure this corrrectly Firefox adds whitespaces everywhere which completly destroy the layout. (same possible when you remove the template data below and show this area in the browser) -->
  237. <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>
  238. <div id="commenttailtemplate" class="comment"><button class="btn btn-default btn-sm"><?php echo I18n::_('Add comment'); ?></button></div>
  239. <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>
  240. </div>
  241. <?php
  242. endif;
  243. ?>
  244. </div>
  245. <section class="container">
  246. <div id="noscript" role="alert" class="nonworking alert alert-info noscript-hide"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true">
  247. <span> <?php echo I18n::_('Loading…'); ?></span><br>
  248. <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>
  249. </div>
  250. </section>
  251. </body>
  252. </html>