This commit is contained in:
rugk 2016-08-15 18:03:23 +02:00
commit bb7fb2054a
25 changed files with 230 additions and 186 deletions

1
.gitattributes vendored
View File

@ -8,4 +8,5 @@ tst/ export-ignore
.gitattributes export-ignore .gitattributes export-ignore
.github export-ignore .github export-ignore
.gitignore export-ignore .gitignore export-ignore
.php_cs export-ignore
.travis.yml export-ignore .travis.yml export-ignore

23
.php_cs Normal file
View File

@ -0,0 +1,23 @@
<?php
/**
* Configuration file for PHP Coding Standards Fixer (php-cs-fixer).
*
* On GitHub: https://github.com/FriendsOfPhp/php-cs-fixer
* More information: http://cs.sensiolabs.org/
*/
$finder = Symfony\CS\Finder\DefaultFinder::create()
->in('lib')
;
return Symfony\CS\Config\Config::create()
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
->fixers(['concat_with_spaces', 'long_array_syntax', 'standardize_not_equal',
'operators_spaces', 'duplicate_semicolon',
'remove_leading_slash_use', 'align_equals',
'single_array_no_trailing_comma', 'phpdoc_indent', 'phpdoc_scalar',
'phpdoc_to_comment', 'phpdoc_trim',
'phpdoc_types', 'print_to_echo', 'self_accessor', 'single_quote',
'spaces_cast', 'ternary_spaces', 'phpdoc_order'])
->finder($finder)
;

View File

@ -741,6 +741,7 @@ $(function() {
this.passwordInput.val(password); this.passwordInput.val(password);
if (cleartext.length > 0) if (cleartext.length > 0)
{ {
$('#pasteFormatter').val(paste.meta.formatter);
this.formatPaste(paste.meta.formatter, cleartext); this.formatPaste(paste.meta.formatter, cleartext);
} }
} }
@ -870,12 +871,12 @@ $(function() {
'<div class="reply">' + '<div class="reply">' +
'<input type="text" id="nickname" class="form-control" title="' + hint + '" placeholder="' + hint + '" />' + '<input type="text" id="nickname" class="form-control" title="' + hint + '" placeholder="' + hint + '" />' +
'<textarea id="replymessage" class="replymessage form-control" cols="80" rows="7"></textarea>' + '<textarea id="replymessage" class="replymessage form-control" cols="80" rows="7"></textarea>' +
'<br /><button id="replybutton" class="btn btn-default btn-sm">' + i18n._('Post comment') + '</button>' + '<br /><div id="replystatus"></div><button id="replybutton" class="btn btn-default btn-sm">' +
'<div id="replystatus"> </div>' + i18n._('Post comment') + '</button></div>'
'</div>'
); );
reply.find('button').click({parentid: commentid}, $.proxy(this.sendComment, this)); reply.find('button').click({parentid: commentid}, $.proxy(this.sendComment, this));
source.after(reply); source.after(reply);
this.replyStatus = $('#replystatus');
$('#replymessage').focus(); $('#replymessage').focus();
}, },
@ -1237,7 +1238,8 @@ $(function() {
rawText: function(event) rawText: function(event)
{ {
event.preventDefault(); event.preventDefault();
var paste = this.clearText.html(); var paste = $('#pasteFormatter').val() === 'markdown' ?
this.prettyPrint.text() : this.clearText.text();
var newDoc = document.open('text/html', 'replace'); var newDoc = document.open('text/html', 'replace');
newDoc.write('<pre>' + paste + '</pre>'); newDoc.write('<pre>' + paste + '</pre>');
newDoc.close(); newDoc.close();
@ -1262,7 +1264,10 @@ $(function() {
this.clonedFile.removeClass('hidden'); this.clonedFile.removeClass('hidden');
this.fileWrap.addClass('hidden'); this.fileWrap.addClass('hidden');
} }
this.message.text(this.clearText.text()); this.message.text(
$('#pasteFormatter').val() === 'markdown' ?
this.prettyPrint.text() : this.clearText.text()
);
$('.navbar-toggle').click(); $('.navbar-toggle').click();
}, },
@ -1370,6 +1375,8 @@ $(function() {
this.stateNewPaste(); this.stateNewPaste();
this.showStatus('', false); this.showStatus('', false);
this.message.text(''); this.message.text('');
this.changeBurnAfterReading();
this.changeOpenDisc();
}, },
/** /**
@ -1402,7 +1409,18 @@ $(function() {
this.errorMessage.removeClass('hidden'); this.errorMessage.removeClass('hidden');
helper.setMessage(this.errorMessage, message); helper.setMessage(this.errorMessage, message);
} }
this.replyStatus.addClass('errorMessage').text(message); if (typeof this.replyStatus !== 'undefined') {
this.replyStatus.addClass('errorMessage');
this.replyStatus.addClass(this.errorMessage.attr('class'));
if (this.status.length)
{
this.replyStatus.html(this.status.html());
}
else
{
this.replyStatus.html(this.errorMessage.html());
}
}
}, },
/** /**
@ -1414,7 +1432,9 @@ $(function() {
*/ */
showStatus: function(message, spin) showStatus: function(message, spin)
{ {
if (typeof this.replyStatus !== 'undefined') {
this.replyStatus.removeClass('errorMessage').text(message); this.replyStatus.removeClass('errorMessage').text(message);
}
if (!message) if (!message)
{ {
this.status.html(' '); this.status.html(' ');
@ -1430,8 +1450,10 @@ $(function() {
{ {
var img = '<img src="img/busy.gif" style="width:16px;height:9px;margin:0 4px 0 0;" />'; var img = '<img src="img/busy.gif" style="width:16px;height:9px;margin:0 4px 0 0;" />';
this.status.prepend(img); this.status.prepend(img);
if (typeof this.replyStatus !== 'undefined') {
this.replyStatus.prepend(img); this.replyStatus.prepend(img);
} }
}
}, },
/** /**
@ -1499,7 +1521,6 @@ $(function() {
this.preview = $('#preview'); this.preview = $('#preview');
this.rawTextButton = $('#rawtextbutton'); this.rawTextButton = $('#rawtextbutton');
this.remainingTime = $('#remainingtime'); this.remainingTime = $('#remainingtime');
this.replyStatus = $('#replystatus');
this.sendButton = $('#sendbutton'); this.sendButton = $('#sendbutton');
this.status = $('#status'); this.status = $('#status');
this.bindEvents(); this.bindEvents();

View File

@ -71,7 +71,7 @@ class Database extends AbstractData
public static function getInstance($options = null) public static function getInstance($options = null)
{ {
// if needed initialize the singleton // if needed initialize the singleton
if (!(self::$_instance instanceof Database)) { if (!(self::$_instance instanceof self)) {
self::$_instance = new self; self::$_instance = new self;
} }
@ -486,7 +486,7 @@ class Database extends AbstractData
$sql = 'SELECT tabname FROM systables '; $sql = 'SELECT tabname FROM systables ';
break; break;
case 'mssql': case 'mssql':
$sql = "SELECT name FROM sysobjects " $sql = 'SELECT name FROM sysobjects '
. "WHERE type = 'U' ORDER BY name"; . "WHERE type = 'U' ORDER BY name";
break; break;
case 'mysql': case 'mysql':
@ -496,22 +496,22 @@ class Database extends AbstractData
$sql = 'SELECT table_name FROM all_tables'; $sql = 'SELECT table_name FROM all_tables';
break; break;
case 'pgsql': case 'pgsql':
$sql = "SELECT c.relname AS table_name " $sql = 'SELECT c.relname AS table_name '
. "FROM pg_class c, pg_user u " . 'FROM pg_class c, pg_user u '
. "WHERE c.relowner = u.usesysid AND c.relkind = 'r' " . "WHERE c.relowner = u.usesysid AND c.relkind = 'r' "
. "AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) " . 'AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) '
. "AND c.relname !~ '^(pg_|sql_)' " . "AND c.relname !~ '^(pg_|sql_)' "
. "UNION " . 'UNION '
. "SELECT c.relname AS table_name " . 'SELECT c.relname AS table_name '
. "FROM pg_class c " . 'FROM pg_class c '
. "WHERE c.relkind = 'r' " . "WHERE c.relkind = 'r' "
. "AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) " . 'AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) '
. "AND NOT EXISTS (SELECT 1 FROM pg_user WHERE usesysid = c.relowner) " . 'AND NOT EXISTS (SELECT 1 FROM pg_user WHERE usesysid = c.relowner) '
. "AND c.relname !~ '^pg_'"; . "AND c.relname !~ '^pg_'";
break; break;
case 'sqlite': case 'sqlite':
$sql = "SELECT name FROM sqlite_master WHERE type='table' " $sql = "SELECT name FROM sqlite_master WHERE type='table' "
. "UNION ALL SELECT name FROM sqlite_temp_master " . 'UNION ALL SELECT name FROM sqlite_temp_master '
. "WHERE type='table' ORDER BY name"; . "WHERE type='table' ORDER BY name";
break; break;
default: default:

View File

@ -49,7 +49,7 @@ class Filesystem extends AbstractData
self::$_dir = $options['dir'] . DIRECTORY_SEPARATOR; self::$_dir = $options['dir'] . DIRECTORY_SEPARATOR;
} }
// if needed initialize the singleton // if needed initialize the singleton
if (!(self::$_instance instanceof Filesystem)) { if (!(self::$_instance instanceof self)) {
self::$_instance = new self; self::$_instance = new self;
self::_init(); self::_init();
} }

View File

@ -372,7 +372,7 @@ class I18n
{ {
$a = explode('-', $a); $a = explode('-', $a);
$b = explode('-', $b); $b = explode('-', $b);
for ($i=0, $n = min(count($a), count($b)); $i < $n; ++$i) { for ($i = 0, $n = min(count($a), count($b)); $i < $n; ++$i) {
if ($a[$i] !== $b[$i]) { if ($a[$i] !== $b[$i]) {
break; break;
} }

View File

@ -296,7 +296,7 @@ class Paste extends AbstractModel
* *
* @access public * @access public
* @throws Exception * @throws Exception
* @return boolean * @return bool
*/ */
public function isBurnafterreading() public function isBurnafterreading()
{ {
@ -313,7 +313,7 @@ class Paste extends AbstractModel
* *
* @access public * @access public
* @throws Exception * @throws Exception
* @return boolean * @return bool
*/ */
public function isOpendiscussion() public function isOpendiscussion()
{ {

View File

@ -168,7 +168,7 @@ class PrivateBin
file_put_contents( file_put_contents(
PATH . $dir . DIRECTORY_SEPARATOR . '.htaccess', PATH . $dir . DIRECTORY_SEPARATOR . '.htaccess',
'Allow from none' . PHP_EOL . 'Allow from none' . PHP_EOL .
'Deny from all'. PHP_EOL, 'Deny from all' . PHP_EOL,
LOCK_EX LOCK_EX
); );
} }
@ -407,7 +407,7 @@ class PrivateBin
// label all the expiration options // label all the expiration options
$expire = array(); $expire = array();
foreach ($this->_conf->getSection('expire_options') as $time => $seconds) { foreach ($this->_conf->getSection('expire_options') as $time => $seconds) {
$expire[$time] = ($seconds == 0) ? I18n::_(ucfirst($time)): Filter::formatHumanReadableTime($time); $expire[$time] = ($seconds == 0) ? I18n::_(ucfirst($time)) : Filter::formatHumanReadableTime($time);
} }
// translate all the formatter options // translate all the formatter options

View File

@ -16,7 +16,7 @@ namespace PrivateBin;
* Request * Request
* *
* parses request parameters and provides helper functions for routing * parses request parameters and provides helper functions for routing
*/ */
class Request class Request
{ {
/** /**

View File

@ -228,7 +228,7 @@ class Vizhash16x16
ImageFilledPolygon($image, $points, 4, $color); ImageFilledPolygon($image, $points, 4, $color);
break; break;
default: default:
$start = $this->getInt() * 360 /256; $start = $this->getInt() * 360 / 256;
$end = $start + $this->getInt() * 180 / 256; $end = $start + $this->getInt() * 180 / 256;
ImageFilledArc($image, $this->getX(), $this->getY(), $this->getX(), $this->getY(), $start, $end, $color, IMG_ARC_PIE); ImageFilledArc($image, $this->getX(), $this->getY(), $this->getX(), $this->getY(), $start, $end, $color, IMG_ARC_PIE);
} }

View File

@ -72,19 +72,19 @@ endif;
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<button id="sendbutton" type="button" class="hidden btn btn-default navbar-btn"> <button id="sendbutton" type="button" class="hidden btn btn-default navbar-btn">
<span class="glyphicon glyphicon-upload" aria-hidden="true"></span> <?php echo I18n::_('Send'); ?> <span class="glyphicon glyphicon-upload" aria-hidden="true"></span> <?php echo I18n::_('Send'), PHP_EOL; ?>
</button> </button>
<?php <?php
if ($EXPIRECLONE): if ($EXPIRECLONE):
?> ?>
<button id="clonebutton" type="button" class="hidden btn btn-default navbar-btn"> <button id="clonebutton" type="button" class="hidden btn btn-default navbar-btn">
<span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Clone'); ?> <span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Clone'), PHP_EOL; ?>
</button> </button>
<?php <?php
endif; endif;
?> ?>
<button id="rawtextbutton" type="button" class="hidden btn btn-default navbar-btn"> <button id="rawtextbutton" type="button" class="hidden btn btn-default navbar-btn">
<span class="glyphicon glyphicon-text-background" aria-hidden="true"></span> <?php echo I18n::_('Raw text'); ?> <span class="glyphicon glyphicon-text-background" aria-hidden="true"></span> <?php echo I18n::_('Raw text'), PHP_EOL; ?>
</button> </button>
</li> </li>
<li class="dropdown"> <li class="dropdown">
@ -108,7 +108,7 @@ foreach ($EXPIRE as $key => $value):
?> ?>
<li> <li>
<a href="#" data-expiration="<?php echo $key; ?>"> <a href="#" data-expiration="<?php echo $key; ?>">
<?php echo $value; ?> <?php echo $value, PHP_EOL; ?>
</a> </a>
</li> </li>
<?php <?php
@ -121,12 +121,12 @@ endforeach;
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li id="burnafterreadingoption" class="checkbox hidden"> <li id="burnafterreadingoption" class="checkbox hidden">
<label> <label>
<input type="checkbox" id="burnafterreading" name="burnafterreading" <?php <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
if ($BURNAFTERREADINGSELECTED): if ($BURNAFTERREADINGSELECTED):
?> checked="checked"<?php ?> checked="checked"<?php
endif; endif;
?> /> ?> />
<?php echo I18n::_('Burn after reading'); ?> <?php echo I18n::_('Burn after reading'), PHP_EOL; ?>
</label> </label>
</li> </li>
<?php <?php
@ -134,12 +134,12 @@ if ($DISCUSSION):
?> ?>
<li id="opendisc" class="checkbox hidden"> <li id="opendisc" class="checkbox hidden">
<label> <label>
<input type="checkbox" id="opendiscussion" name="opendiscussion" <?php <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
if ($OPENDISCUSSION): if ($OPENDISCUSSION):
?> checked="checked"<?php ?> checked="checked"<?php
endif; endif;
?> /> ?> />
<?php echo I18n::_('Open discussion'); ?> <?php echo I18n::_('Open discussion'), PHP_EOL; ?>
</label> </label>
</li> </li>
<?php <?php
@ -156,7 +156,7 @@ foreach ($FORMATTER as $key => $value):
?> ?>
<li> <li>
<a href="#" data-format="<?php echo $key; ?>"> <a href="#" data-format="<?php echo $key; ?>">
<?php echo $value; ?> <?php echo $value, PHP_EOL; ?>
</a> </a>
</li> </li>
<?php <?php
@ -199,7 +199,7 @@ if ($FILEUPLOAD):
</li> </li>
<li> <li>
<a id="fileremovebutton" href="#"> <a id="fileremovebutton" href="#">
<?php echo I18n::_('Remove attachment'); ?> <?php echo I18n::_('Remove attachment'), PHP_EOL; ?>
</a> </a>
</li> </li>
</ul> </ul>
@ -233,7 +233,7 @@ endif;
?> ?>
<li> <li>
<button id="newbutton" type="button" class="reloadlink hidden btn btn-default navbar-btn"> <button id="newbutton" type="button" class="reloadlink hidden btn btn-default navbar-btn">
<span class="glyphicon glyphicon-file" aria-hidden="true"></span> <?php echo I18n::_('New'); ?> <span class="glyphicon glyphicon-file" aria-hidden="true"></span> <?php echo I18n::_('New'), PHP_EOL; ?>
</button> </button>
</li> </li>
</ul> </ul>
@ -245,7 +245,7 @@ endif;
if (strlen($NOTICE)): if (strlen($NOTICE)):
?> ?>
<div role="alert" class="alert alert-info"> <div role="alert" class="alert alert-info">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <?php echo htmlspecialchars($NOTICE); ?> <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <?php echo htmlspecialchars($NOTICE), PHP_EOL; ?>
</div> </div>
<?php <?php
endif; endif;
@ -264,7 +264,7 @@ endif;
if (strlen($STATUS)): if (strlen($STATUS)):
?> ?>
<div id="status" role="alert" class="alert alert-success"> <div id="status" role="alert" class="alert alert-success">
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <?php echo htmlspecialchars($STATUS); ?> <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <?php echo htmlspecialchars($STATUS), PHP_EOL; ?>
</div> </div>
<?php <?php
endif; endif;
@ -276,7 +276,7 @@ endif;
?>alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo htmlspecialchars($ERROR); ?></div> ?>alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo htmlspecialchars($ERROR); ?></div>
<noscript><div id="noscript" role="alert" class="nonworking alert alert-warning"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <?php echo I18n::_('Javascript is required for PrivateBin to work.<br />Sorry for the inconvenience.'); ?></div></noscript> <noscript><div id="noscript" role="alert" class="nonworking alert alert-warning"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <?php echo I18n::_('Javascript is required for PrivateBin to work.<br />Sorry for the inconvenience.'); ?></div></noscript>
<div id="oldienotice" role="alert" class="hidden nonworking alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo I18n::_('PrivateBin requires a modern browser to work.'); ?></div> <div id="oldienotice" role="alert" class="hidden nonworking alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo I18n::_('PrivateBin requires a modern browser to work.'); ?></div>
<div id="ienotice" role="alert" class="hidden alert alert-warning"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> <?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'); ?> <div id="ienotice" role="alert" class="hidden alert alert-warning"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> <?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'), PHP_EOL; ?>
<a href="https://www.mozilla.org/firefox/">Firefox</a>, <a href="https://www.mozilla.org/firefox/">Firefox</a>,
<a href="https://www.opera.com/">Opera</a>, <a href="https://www.opera.com/">Opera</a>,
<a href="https://www.google.com/chrome">Chrome</a>, <a href="https://www.google.com/chrome">Chrome</a>,
@ -290,7 +290,7 @@ endif;
if (strlen($URLSHORTENER)): if (strlen($URLSHORTENER)):
?> ?>
<button id="shortenbutton" data-shortener="<?php echo htmlspecialchars($URLSHORTENER); ?>" type="button" class="btn btn-primary"> <button id="shortenbutton" data-shortener="<?php echo htmlspecialchars($URLSHORTENER); ?>" type="button" class="btn btn-primary">
<span class="glyphicon glyphicon-send" aria-hidden="true"></span> <?php echo I18n::_('Shorten URL'); ?> <span class="glyphicon glyphicon-send" aria-hidden="true"></span> <?php echo I18n::_('Shorten URL'), PHP_EOL; ?>
</button> </button>
<?php <?php
endif; endif;
@ -323,7 +323,7 @@ endif;
<h4 class="col-md-5 col-xs-8"><?php echo I18n::_('PrivateBin'); ?> <small>- <?php echo I18n::_('Because ignorance is bliss'); ?></small></h4> <h4 class="col-md-5 col-xs-8"><?php echo I18n::_('PrivateBin'); ?> <small>- <?php echo I18n::_('Because ignorance is bliss'); ?></small></h4>
<p class="col-md-1 col-xs-4 text-center"><?php echo $VERSION; ?></p> <p class="col-md-1 col-xs-4 text-center"><?php echo $VERSION; ?></p>
<p id="aboutbox" class="col-md-6 col-xs-12"> <p id="aboutbox" class="col-md-6 col-xs-12">
<?php echo I18n::_('PrivateBin 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://github.com/PrivateBin/PrivateBin/wiki">project page</a>.'); ?> <?php echo I18n::_('PrivateBin 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://github.com/PrivateBin/PrivateBin/wiki">project page</a>.'), PHP_EOL; ?>
</p> </p>
</div> </div>
</footer> </footer>

View File

@ -71,19 +71,19 @@ endif;
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<button id="sendbutton" type="button" class="hidden btn btn-warning navbar-btn"> <button id="sendbutton" type="button" class="hidden btn btn-warning navbar-btn">
<span class="glyphicon glyphicon-upload" aria-hidden="true"></span> <?php echo I18n::_('Send'); ?> <span class="glyphicon glyphicon-upload" aria-hidden="true"></span> <?php echo I18n::_('Send'), PHP_EOL; ?>
</button> </button>
<?php <?php
if ($EXPIRECLONE): if ($EXPIRECLONE):
?> ?>
<button id="clonebutton" type="button" class="hidden btn btn-warning navbar-btn"> <button id="clonebutton" type="button" class="hidden btn btn-warning navbar-btn">
<span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Clone'); ?> <span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Clone'), PHP_EOL; ?>
</button> </button>
<?php <?php
endif; endif;
?> ?>
<button id="rawtextbutton" type="button" class="hidden btn btn-warning navbar-btn"> <button id="rawtextbutton" type="button" class="hidden btn btn-warning navbar-btn">
<span class="glyphicon glyphicon-text-background" aria-hidden="true"></span> <?php echo I18n::_('Raw text'); ?> <span class="glyphicon glyphicon-text-background" aria-hidden="true"></span> <?php echo I18n::_('Raw text'), PHP_EOL; ?>
</button> </button>
</li> </li>
<li class="dropdown"> <li class="dropdown">
@ -107,7 +107,7 @@ foreach ($EXPIRE as $key => $value):
?> ?>
<li> <li>
<a href="#" data-expiration="<?php echo $key; ?>"> <a href="#" data-expiration="<?php echo $key; ?>">
<?php echo $value; ?> <?php echo $value, PHP_EOL; ?>
</a> </a>
</li> </li>
<?php <?php
@ -118,12 +118,12 @@ endforeach;
<li> <li>
<div id="burnafterreadingoption" class="navbar-text checkbox hidden"> <div id="burnafterreadingoption" class="navbar-text checkbox hidden">
<label> <label>
<input type="checkbox" id="burnafterreading" name="burnafterreading" <?php <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
if ($BURNAFTERREADINGSELECTED): if ($BURNAFTERREADINGSELECTED):
?> checked="checked"<?php ?> checked="checked"<?php
endif; endif;
?> /> ?> />
<?php echo I18n::_('Burn after reading'); ?> <?php echo I18n::_('Burn after reading'), PHP_EOL; ?>
</label> </label>
</div> </div>
</li> </li>
@ -133,12 +133,12 @@ if ($DISCUSSION):
<li> <li>
<div id="opendisc" class="navbar-text checkbox hidden"> <div id="opendisc" class="navbar-text checkbox hidden">
<label> <label>
<input type="checkbox" id="opendiscussion" name="opendiscussion" <?php <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
if ($OPENDISCUSSION): if ($OPENDISCUSSION):
?> checked="checked"<?php ?> checked="checked"<?php
endif; endif;
?> /> ?> />
<?php echo I18n::_('Open discussion'); ?> <?php echo I18n::_('Open discussion'), PHP_EOL; ?>
</label> </label>
</div> </div>
</li> </li>
@ -165,7 +165,7 @@ if ($FILEUPLOAD):
</li> </li>
<li> <li>
<a id="fileremovebutton" href="#"> <a id="fileremovebutton" href="#">
<?php echo I18n::_('Remove attachment'); ?> <?php echo I18n::_('Remove attachment'), PHP_EOL; ?>
</a> </a>
</li> </li>
</ul> </ul>
@ -194,7 +194,7 @@ foreach ($FORMATTER as $key => $value):
?> ?>
<li> <li>
<a href="#" data-format="<?php echo $key; ?>"> <a href="#" data-format="<?php echo $key; ?>">
<?php echo $value; ?> <?php echo $value, PHP_EOL; ?>
</a> </a>
</li> </li>
<?php <?php
@ -228,7 +228,7 @@ endif;
?> ?>
<li> <li>
<button id="newbutton" type="button" class="reloadlink hidden btn btn-warning navbar-btn"> <button id="newbutton" type="button" class="reloadlink hidden btn btn-warning navbar-btn">
<span class="glyphicon glyphicon-file" aria-hidden="true"></span> <?php echo I18n::_('New'); ?> <span class="glyphicon glyphicon-file" aria-hidden="true"></span> <?php echo I18n::_('New'), PHP_EOL; ?>
</button> </button>
</li> </li>
</ul> </ul>
@ -239,7 +239,7 @@ endif;
if (strlen($NOTICE)): if (strlen($NOTICE)):
?> ?>
<div role="alert" class="alert alert-info"> <div role="alert" class="alert alert-info">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <?php echo htmlspecialchars($NOTICE); ?> <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <?php echo htmlspecialchars($NOTICE), PHP_EOL; ?>
</div> </div>
<?php <?php
endif; endif;
@ -258,7 +258,7 @@ endif;
if (strlen($STATUS)): if (strlen($STATUS)):
?> ?>
<div id="status" role="alert" class="alert alert-success"> <div id="status" role="alert" class="alert alert-success">
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <?php echo htmlspecialchars($STATUS); ?> <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <?php echo htmlspecialchars($STATUS), PHP_EOL; ?>
</div> </div>
<?php <?php
endif; endif;
@ -270,7 +270,7 @@ endif;
?>alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo htmlspecialchars($ERROR); ?></div> ?>alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo htmlspecialchars($ERROR); ?></div>
<noscript><div id="noscript" role="alert" class="nonworking alert alert-error"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <?php echo I18n::_('Javascript is required for PrivateBin to work.<br />Sorry for the inconvenience.'); ?></div></noscript> <noscript><div id="noscript" role="alert" class="nonworking alert alert-error"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <?php echo I18n::_('Javascript is required for PrivateBin to work.<br />Sorry for the inconvenience.'); ?></div></noscript>
<div id="oldienotice" role="alert" class="hidden nonworking alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo I18n::_('PrivateBin requires a modern browser to work.'); ?></div> <div id="oldienotice" role="alert" class="hidden nonworking alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo I18n::_('PrivateBin requires a modern browser to work.'); ?></div>
<div id="ienotice" role="alert" class="hidden alert alert-error"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> <?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'); ?> <div id="ienotice" role="alert" class="hidden alert alert-error"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> <?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'), PHP_EOL; ?>
<a href="https://www.mozilla.org/firefox/">Firefox</a>, <a href="https://www.mozilla.org/firefox/">Firefox</a>,
<a href="https://www.opera.com/">Opera</a>, <a href="https://www.opera.com/">Opera</a>,
<a href="https://www.google.com/chrome">Chrome</a>, <a href="https://www.google.com/chrome">Chrome</a>,
@ -284,7 +284,7 @@ endif;
if (strlen($URLSHORTENER)): if (strlen($URLSHORTENER)):
?> ?>
<button id="shortenbutton" data-shortener="<?php echo htmlspecialchars($URLSHORTENER); ?>" type="button" class="btn btn-warning"> <button id="shortenbutton" data-shortener="<?php echo htmlspecialchars($URLSHORTENER); ?>" type="button" class="btn btn-warning">
<span class="glyphicon glyphicon-send" aria-hidden="true"></span> <?php echo I18n::_('Shorten URL'); ?> <span class="glyphicon glyphicon-send" aria-hidden="true"></span> <?php echo I18n::_('Shorten URL'), PHP_EOL; ?>
</button> </button>
<?php <?php
endif; endif;
@ -317,7 +317,7 @@ endif;
<h4 class="col-md-5 col-xs-8"><?php echo I18n::_('PrivateBin'); ?> <small>- <?php echo I18n::_('Because ignorance is bliss'); ?></small></h4> <h4 class="col-md-5 col-xs-8"><?php echo I18n::_('PrivateBin'); ?> <small>- <?php echo I18n::_('Because ignorance is bliss'); ?></small></h4>
<p class="col-md-1 col-xs-4 text-center"><?php echo $VERSION; ?></p> <p class="col-md-1 col-xs-4 text-center"><?php echo $VERSION; ?></p>
<p id="aboutbox" class="col-md-6 col-xs-12"> <p id="aboutbox" class="col-md-6 col-xs-12">
<?php echo I18n::_('PrivateBin 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://github.com/PrivateBin/PrivateBin/wiki">project page</a>.'); ?> <?php echo I18n::_('PrivateBin 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://github.com/PrivateBin/PrivateBin/wiki">project page</a>.'), PHP_EOL; ?>
</p> </p>
</div> </div>
</footer> </footer>

View File

@ -71,19 +71,19 @@ endif;
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<button id="newbutton" type="button" class="reloadlink hidden btn btn-warning navbar-btn"> <button id="newbutton" type="button" class="reloadlink hidden btn btn-warning navbar-btn">
<span class="glyphicon glyphicon-file" aria-hidden="true"></span> <?php echo I18n::_('New'); ?> <span class="glyphicon glyphicon-file" aria-hidden="true"></span> <?php echo I18n::_('New'), PHP_EOL; ?>
</button> </button>
<?php <?php
if ($EXPIRECLONE): if ($EXPIRECLONE):
?> ?>
<button id="clonebutton" type="button" class="hidden btn btn-warning navbar-btn"> <button id="clonebutton" type="button" class="hidden btn btn-warning navbar-btn">
<span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Clone'); ?> <span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Clone'), PHP_EOL; ?>
</button> </button>
<?php <?php
endif; endif;
?> ?>
<button id="rawtextbutton" type="button" class="hidden btn btn-warning navbar-btn"> <button id="rawtextbutton" type="button" class="hidden btn btn-warning navbar-btn">
<span class="glyphicon glyphicon-text-background" aria-hidden="true"></span> <?php echo I18n::_('Raw text'); ?> <span class="glyphicon glyphicon-text-background" aria-hidden="true"></span> <?php echo I18n::_('Raw text'), PHP_EOL; ?>
</button> </button>
</li> </li>
<li class="dropdown"> <li class="dropdown">
@ -107,7 +107,7 @@ foreach ($EXPIRE as $key => $value):
?> ?>
<li> <li>
<a href="#" data-expiration="<?php echo $key; ?>"> <a href="#" data-expiration="<?php echo $key; ?>">
<?php echo $value; ?> <?php echo $value, PHP_EOL; ?>
</a> </a>
</li> </li>
<?php <?php
@ -118,12 +118,12 @@ endforeach;
<li> <li>
<div id="burnafterreadingoption" class="navbar-text checkbox hidden"> <div id="burnafterreadingoption" class="navbar-text checkbox hidden">
<label> <label>
<input type="checkbox" id="burnafterreading" name="burnafterreading" <?php <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
if ($BURNAFTERREADINGSELECTED): if ($BURNAFTERREADINGSELECTED):
?> checked="checked"<?php ?> checked<?php
endif; endif;
?> /> ?> />
<?php echo I18n::_('Burn after reading'); ?> <?php echo I18n::_('Burn after reading'), PHP_EOL; ?>
</label> </label>
</div> </div>
</li> </li>
@ -133,12 +133,12 @@ if ($DISCUSSION):
<li> <li>
<div id="opendisc" class="navbar-text checkbox hidden"> <div id="opendisc" class="navbar-text checkbox hidden">
<label> <label>
<input type="checkbox" id="opendiscussion" name="opendiscussion" <?php <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
if ($OPENDISCUSSION): if ($OPENDISCUSSION):
?> checked="checked"<?php ?> checked<?php
endif; endif;
?> /> ?> />
<?php echo I18n::_('Open discussion'); ?> <?php echo I18n::_('Open discussion'), PHP_EOL; ?>
</label> </label>
</div> </div>
</li> </li>
@ -165,7 +165,7 @@ if ($FILEUPLOAD):
</li> </li>
<li> <li>
<a id="fileremovebutton" href="#"> <a id="fileremovebutton" href="#">
<?php echo I18n::_('Remove attachment'); ?> <?php echo I18n::_('Remove attachment'), PHP_EOL; ?>
</a> </a>
</li> </li>
</ul> </ul>
@ -194,7 +194,7 @@ foreach ($FORMATTER as $key => $value):
?> ?>
<li> <li>
<a href="#" data-format="<?php echo $key; ?>"> <a href="#" data-format="<?php echo $key; ?>">
<?php echo $value; ?> <?php echo $value, PHP_EOL; ?>
</a> </a>
</li> </li>
<?php <?php
@ -228,7 +228,7 @@ endif;
?> ?>
<li> <li>
<button id="sendbutton" type="button" class="hidden btn btn-warning navbar-btn"> <button id="sendbutton" type="button" class="hidden btn btn-warning navbar-btn">
<span class="glyphicon glyphicon-upload" aria-hidden="true"></span> <?php echo I18n::_('Send'); ?> <span class="glyphicon glyphicon-upload" aria-hidden="true"></span> <?php echo I18n::_('Send'), PHP_EOL; ?>
</button> </button>
</li> </li>
</ul> </ul>
@ -239,7 +239,7 @@ endif;
if (strlen($NOTICE)): if (strlen($NOTICE)):
?> ?>
<div role="alert" class="alert alert-info"> <div role="alert" class="alert alert-info">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <?php echo htmlspecialchars($NOTICE); ?> <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <?php echo htmlspecialchars($NOTICE), PHP_EOL; ?>
</div> </div>
<?php <?php
endif; endif;
@ -258,7 +258,7 @@ endif;
if (strlen($STATUS)): if (strlen($STATUS)):
?> ?>
<div id="status" role="alert" class="alert alert-success"> <div id="status" role="alert" class="alert alert-success">
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <?php echo htmlspecialchars($STATUS); ?> <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <?php echo htmlspecialchars($STATUS), PHP_EOL; ?>
</div> </div>
<?php <?php
endif; endif;
@ -270,7 +270,7 @@ endif;
?>alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo htmlspecialchars($ERROR); ?></div> ?>alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo htmlspecialchars($ERROR); ?></div>
<noscript><div id="noscript" role="alert" class="nonworking alert alert-error"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <?php echo I18n::_('Javascript is required for PrivateBin to work.<br />Sorry for the inconvenience.'); ?></div></noscript> <noscript><div id="noscript" role="alert" class="nonworking alert alert-error"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <?php echo I18n::_('Javascript is required for PrivateBin to work.<br />Sorry for the inconvenience.'); ?></div></noscript>
<div id="oldienotice" role="alert" class="hidden nonworking alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo I18n::_('PrivateBin requires a modern browser to work.'); ?></div> <div id="oldienotice" role="alert" class="hidden nonworking alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo I18n::_('PrivateBin requires a modern browser to work.'); ?></div>
<div id="ienotice" role="alert" class="hidden alert alert-error"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> <?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'); ?> <div id="ienotice" role="alert" class="hidden alert alert-error"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> <?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'), PHP_EOL; ?>
<a href="https://www.mozilla.org/firefox/">Firefox</a>, <a href="https://www.mozilla.org/firefox/">Firefox</a>,
<a href="https://www.opera.com/">Opera</a>, <a href="https://www.opera.com/">Opera</a>,
<a href="https://www.google.com/chrome">Chrome</a>, <a href="https://www.google.com/chrome">Chrome</a>,
@ -284,7 +284,7 @@ endif;
if (strlen($URLSHORTENER)): if (strlen($URLSHORTENER)):
?> ?>
<button id="shortenbutton" data-shortener="<?php echo htmlspecialchars($URLSHORTENER); ?>" type="button" class="btn btn-warning"> <button id="shortenbutton" data-shortener="<?php echo htmlspecialchars($URLSHORTENER); ?>" type="button" class="btn btn-warning">
<span class="glyphicon glyphicon-send" aria-hidden="true"></span> <?php echo I18n::_('Shorten URL'); ?> <span class="glyphicon glyphicon-send" aria-hidden="true"></span> <?php echo I18n::_('Shorten URL'), PHP_EOL; ?>
</button> </button>
<?php <?php
endif; endif;
@ -317,7 +317,7 @@ endif;
<h4 class="col-md-5 col-xs-8"><?php echo I18n::_('PrivateBin'); ?> <small>- <?php echo I18n::_('Because ignorance is bliss'); ?></small></h4> <h4 class="col-md-5 col-xs-8"><?php echo I18n::_('PrivateBin'); ?> <small>- <?php echo I18n::_('Because ignorance is bliss'); ?></small></h4>
<p class="col-md-1 col-xs-4 text-center"><?php echo $VERSION; ?></p> <p class="col-md-1 col-xs-4 text-center"><?php echo $VERSION; ?></p>
<p id="aboutbox" class="col-md-6 col-xs-12"> <p id="aboutbox" class="col-md-6 col-xs-12">
<?php echo I18n::_('PrivateBin 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://github.com/PrivateBin/PrivateBin/wiki">project page</a>.'); ?> <?php echo I18n::_('PrivateBin 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://github.com/PrivateBin/PrivateBin/wiki">project page</a>.'), PHP_EOL; ?>
</p> </p>
</div> </div>
</footer> </footer>

View File

@ -71,19 +71,19 @@ endif;
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<button id="sendbutton" type="button" class="hidden btn btn-primary navbar-btn"> <button id="sendbutton" type="button" class="hidden btn btn-primary navbar-btn">
<span class="glyphicon glyphicon-upload" aria-hidden="true"></span> <?php echo I18n::_('Send'); ?> <span class="glyphicon glyphicon-upload" aria-hidden="true"></span> <?php echo I18n::_('Send'), PHP_EOL; ?>
</button> </button>
<?php <?php
if ($EXPIRECLONE): if ($EXPIRECLONE):
?> ?>
<button id="clonebutton" type="button" class="hidden btn btn-default navbar-btn"> <button id="clonebutton" type="button" class="hidden btn btn-default navbar-btn">
<span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Clone'); ?> <span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Clone'), PHP_EOL; ?>
</button> </button>
<?php <?php
endif; endif;
?> ?>
<button id="rawtextbutton" type="button" class="hidden btn btn-default navbar-btn"> <button id="rawtextbutton" type="button" class="hidden btn btn-default navbar-btn">
<span class="glyphicon glyphicon-text-background" aria-hidden="true"></span> <?php echo I18n::_('Raw text'); ?> <span class="glyphicon glyphicon-text-background" aria-hidden="true"></span> <?php echo I18n::_('Raw text'), PHP_EOL; ?>
</button> </button>
</li> </li>
<li class="dropdown"> <li class="dropdown">
@ -107,7 +107,7 @@ foreach ($EXPIRE as $key => $value):
?> ?>
<li> <li>
<a href="#" data-expiration="<?php echo $key; ?>"> <a href="#" data-expiration="<?php echo $key; ?>">
<?php echo $value; ?> <?php echo $value, PHP_EOL; ?>
</a> </a>
</li> </li>
<?php <?php
@ -118,12 +118,12 @@ endforeach;
<li> <li>
<div id="burnafterreadingoption" class="navbar-text checkbox hidden"> <div id="burnafterreadingoption" class="navbar-text checkbox hidden">
<label> <label>
<input type="checkbox" id="burnafterreading" name="burnafterreading" <?php <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
if ($BURNAFTERREADINGSELECTED): if ($BURNAFTERREADINGSELECTED):
?> checked="checked"<?php ?> checked="checked"<?php
endif; endif;
?> /> ?> />
<?php echo I18n::_('Burn after reading'); ?> <?php echo I18n::_('Burn after reading'), PHP_EOL; ?>
</label> </label>
</div> </div>
</li> </li>
@ -133,12 +133,12 @@ if ($DISCUSSION):
<li> <li>
<div id="opendisc" class="navbar-text checkbox hidden"> <div id="opendisc" class="navbar-text checkbox hidden">
<label> <label>
<input type="checkbox" id="opendiscussion" name="opendiscussion" <?php <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
if ($OPENDISCUSSION): if ($OPENDISCUSSION):
?> checked="checked"<?php ?> checked="checked"<?php
endif; endif;
?> /> ?> />
<?php echo I18n::_('Open discussion'); ?> <?php echo I18n::_('Open discussion'), PHP_EOL; ?>
</label> </label>
</div> </div>
</li> </li>
@ -165,7 +165,7 @@ if ($FILEUPLOAD):
</li> </li>
<li> <li>
<a id="fileremovebutton" href="#"> <a id="fileremovebutton" href="#">
<?php echo I18n::_('Remove attachment'); ?> <?php echo I18n::_('Remove attachment'), PHP_EOL; ?>
</a> </a>
</li> </li>
</ul> </ul>
@ -194,7 +194,7 @@ foreach ($FORMATTER as $key => $value):
?> ?>
<li> <li>
<a href="#" data-format="<?php echo $key; ?>"> <a href="#" data-format="<?php echo $key; ?>">
<?php echo $value; ?> <?php echo $value, PHP_EOL; ?>
</a> </a>
</li> </li>
<?php <?php
@ -228,7 +228,7 @@ endif;
?> ?>
<li> <li>
<button id="newbutton" type="button" class="reloadlink hidden btn btn-default navbar-btn"> <button id="newbutton" type="button" class="reloadlink hidden btn btn-default navbar-btn">
<span class="glyphicon glyphicon-file" aria-hidden="true"></span> <?php echo I18n::_('New'); ?> <span class="glyphicon glyphicon-file" aria-hidden="true"></span> <?php echo I18n::_('New'), PHP_EOL; ?>
</button> </button>
</li> </li>
</ul> </ul>
@ -239,7 +239,7 @@ endif;
if (strlen($NOTICE)): if (strlen($NOTICE)):
?> ?>
<div role="alert" class="alert alert-info"> <div role="alert" class="alert alert-info">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <?php echo htmlspecialchars($NOTICE); ?> <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <?php echo htmlspecialchars($NOTICE), PHP_EOL; ?>
</div> </div>
<?php <?php
endif; endif;
@ -258,7 +258,7 @@ endif;
if (strlen($STATUS)): if (strlen($STATUS)):
?> ?>
<div id="status" role="alert" class="alert alert-success"> <div id="status" role="alert" class="alert alert-success">
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <?php echo htmlspecialchars($STATUS); ?> <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <?php echo htmlspecialchars($STATUS), PHP_EOL; ?>
</div> </div>
<?php <?php
endif; endif;
@ -270,7 +270,7 @@ endif;
?>alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo htmlspecialchars($ERROR); ?></div> ?>alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo htmlspecialchars($ERROR); ?></div>
<noscript><div id="noscript" role="alert" class="nonworking alert alert-warning"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <?php echo I18n::_('Javascript is required for PrivateBin to work.<br />Sorry for the inconvenience.'); ?></div></noscript> <noscript><div id="noscript" role="alert" class="nonworking alert alert-warning"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <?php echo I18n::_('Javascript is required for PrivateBin to work.<br />Sorry for the inconvenience.'); ?></div></noscript>
<div id="oldienotice" role="alert" class="hidden nonworking alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo I18n::_('PrivateBin requires a modern browser to work.'); ?></div> <div id="oldienotice" role="alert" class="hidden nonworking alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo I18n::_('PrivateBin requires a modern browser to work.'); ?></div>
<div id="ienotice" role="alert" class="hidden alert alert-warning"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> <?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'); ?> <div id="ienotice" role="alert" class="hidden alert alert-warning"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> <?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'), PHP_EOL; ?>
<a href="https://www.mozilla.org/firefox/">Firefox</a>, <a href="https://www.mozilla.org/firefox/">Firefox</a>,
<a href="https://www.opera.com/">Opera</a>, <a href="https://www.opera.com/">Opera</a>,
<a href="https://www.google.com/chrome">Chrome</a>, <a href="https://www.google.com/chrome">Chrome</a>,
@ -284,7 +284,7 @@ endif;
if (strlen($URLSHORTENER)): if (strlen($URLSHORTENER)):
?> ?>
<button id="shortenbutton" data-shortener="<?php echo htmlspecialchars($URLSHORTENER); ?>" type="button" class="btn btn-primary"> <button id="shortenbutton" data-shortener="<?php echo htmlspecialchars($URLSHORTENER); ?>" type="button" class="btn btn-primary">
<span class="glyphicon glyphicon-send" aria-hidden="true"></span> <?php echo I18n::_('Shorten URL'); ?> <span class="glyphicon glyphicon-send" aria-hidden="true"></span> <?php echo I18n::_('Shorten URL'), PHP_EOL; ?>
</button> </button>
<?php <?php
endif; endif;
@ -317,7 +317,7 @@ endif;
<h4 class="col-md-5 col-xs-8"><?php echo I18n::_('PrivateBin'); ?> <small>- <?php echo I18n::_('Because ignorance is bliss'); ?></small></h4> <h4 class="col-md-5 col-xs-8"><?php echo I18n::_('PrivateBin'); ?> <small>- <?php echo I18n::_('Because ignorance is bliss'); ?></small></h4>
<p class="col-md-1 col-xs-4 text-center"><?php echo $VERSION; ?></p> <p class="col-md-1 col-xs-4 text-center"><?php echo $VERSION; ?></p>
<p id="aboutbox" class="col-md-6 col-xs-12"> <p id="aboutbox" class="col-md-6 col-xs-12">
<?php echo I18n::_('PrivateBin 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://github.com/PrivateBin/PrivateBin/wiki">project page</a>.'); ?> <?php echo I18n::_('PrivateBin 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://github.com/PrivateBin/PrivateBin/wiki">project page</a>.'), PHP_EOL; ?>
</p> </p>
</div> </div>
</footer> </footer>

View File

@ -71,19 +71,19 @@ endif;
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li> <li>
<button id="newbutton" type="button" class="reloadlink hidden btn btn-default navbar-btn"> <button id="newbutton" type="button" class="reloadlink hidden btn btn-default navbar-btn">
<span class="glyphicon glyphicon-file" aria-hidden="true"></span> <?php echo I18n::_('New'); ?> <span class="glyphicon glyphicon-file" aria-hidden="true"></span> <?php echo I18n::_('New'), PHP_EOL; ?>
</button> </button>
<?php <?php
if ($EXPIRECLONE): if ($EXPIRECLONE):
?> ?>
<button id="clonebutton" type="button" class="hidden btn btn-default navbar-btn"> <button id="clonebutton" type="button" class="hidden btn btn-default navbar-btn">
<span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Clone'); ?> <span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Clone'), PHP_EOL; ?>
</button> </button>
<?php <?php
endif; endif;
?> ?>
<button id="rawtextbutton" type="button" class="hidden btn btn-default navbar-btn"> <button id="rawtextbutton" type="button" class="hidden btn btn-default navbar-btn">
<span class="glyphicon glyphicon-text-background" aria-hidden="true"></span> <?php echo I18n::_('Raw text'); ?> <span class="glyphicon glyphicon-text-background" aria-hidden="true"></span> <?php echo I18n::_('Raw text'), PHP_EOL; ?>
</button> </button>
</li> </li>
<li class="dropdown"> <li class="dropdown">
@ -107,7 +107,7 @@ foreach ($EXPIRE as $key => $value):
?> ?>
<li> <li>
<a href="#" data-expiration="<?php echo $key; ?>"> <a href="#" data-expiration="<?php echo $key; ?>">
<?php echo $value; ?> <?php echo $value, PHP_EOL; ?>
</a> </a>
</li> </li>
<?php <?php
@ -118,12 +118,12 @@ endforeach;
<li> <li>
<div id="burnafterreadingoption" class="navbar-text checkbox hidden"> <div id="burnafterreadingoption" class="navbar-text checkbox hidden">
<label> <label>
<input type="checkbox" id="burnafterreading" name="burnafterreading" <?php <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
if ($BURNAFTERREADINGSELECTED): if ($BURNAFTERREADINGSELECTED):
?> checked="checked"<?php ?> checked="checked"<?php
endif; endif;
?> /> ?> />
<?php echo I18n::_('Burn after reading'); ?> <?php echo I18n::_('Burn after reading'), PHP_EOL; ?>
</label> </label>
</div> </div>
</li> </li>
@ -133,12 +133,12 @@ if ($DISCUSSION):
<li> <li>
<div id="opendisc" class="navbar-text checkbox hidden"> <div id="opendisc" class="navbar-text checkbox hidden">
<label> <label>
<input type="checkbox" id="opendiscussion" name="opendiscussion" <?php <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
if ($OPENDISCUSSION): if ($OPENDISCUSSION):
?> checked="checked"<?php ?> checked="checked"<?php
endif; endif;
?> /> ?> />
<?php echo I18n::_('Open discussion'); ?> <?php echo I18n::_('Open discussion'), PHP_EOL; ?>
</label> </label>
</div> </div>
</li> </li>
@ -165,7 +165,7 @@ if ($FILEUPLOAD):
</li> </li>
<li> <li>
<a id="fileremovebutton" href="#"> <a id="fileremovebutton" href="#">
<?php echo I18n::_('Remove attachment'); ?> <?php echo I18n::_('Remove attachment'), PHP_EOL; ?>
</a> </a>
</li> </li>
</ul> </ul>
@ -194,7 +194,7 @@ foreach ($FORMATTER as $key => $value):
?> ?>
<li> <li>
<a href="#" data-format="<?php echo $key; ?>"> <a href="#" data-format="<?php echo $key; ?>">
<?php echo $value; ?> <?php echo $value, PHP_EOL; ?>
</a> </a>
</li> </li>
<?php <?php
@ -228,7 +228,7 @@ endif;
?> ?>
<li> <li>
<button id="sendbutton" type="button" class="hidden btn btn-primary navbar-btn"> <button id="sendbutton" type="button" class="hidden btn btn-primary navbar-btn">
<span class="glyphicon glyphicon-upload" aria-hidden="true"></span> <?php echo I18n::_('Send'); ?> <span class="glyphicon glyphicon-upload" aria-hidden="true"></span> <?php echo I18n::_('Send'), PHP_EOL; ?>
</button> </button>
</li> </li>
</ul> </ul>
@ -239,7 +239,7 @@ endif;
if (strlen($NOTICE)): if (strlen($NOTICE)):
?> ?>
<div role="alert" class="alert alert-info"> <div role="alert" class="alert alert-info">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <?php echo htmlspecialchars($NOTICE); ?> <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <?php echo htmlspecialchars($NOTICE), PHP_EOL; ?>
</div> </div>
<?php <?php
endif; endif;
@ -258,7 +258,7 @@ endif;
if (strlen($STATUS)): if (strlen($STATUS)):
?> ?>
<div id="status" role="alert" class="alert alert-success"> <div id="status" role="alert" class="alert alert-success">
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <?php echo htmlspecialchars($STATUS); ?> <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <?php echo htmlspecialchars($STATUS), PHP_EOL; ?>
</div> </div>
<?php <?php
endif; endif;
@ -270,7 +270,7 @@ endif;
?>alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo htmlspecialchars($ERROR); ?></div> ?>alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo htmlspecialchars($ERROR); ?></div>
<noscript><div id="noscript" role="alert" class="nonworking alert alert-warning"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <?php echo I18n::_('Javascript is required for PrivateBin to work.<br />Sorry for the inconvenience.'); ?></div></noscript> <noscript><div id="noscript" role="alert" class="nonworking alert alert-warning"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <?php echo I18n::_('Javascript is required for PrivateBin to work.<br />Sorry for the inconvenience.'); ?></div></noscript>
<div id="oldienotice" role="alert" class="hidden nonworking alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo I18n::_('PrivateBin requires a modern browser to work.'); ?></div> <div id="oldienotice" role="alert" class="hidden nonworking alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo I18n::_('PrivateBin requires a modern browser to work.'); ?></div>
<div id="ienotice" role="alert" class="hidden alert alert-warning"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> <?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'); ?> <div id="ienotice" role="alert" class="hidden alert alert-warning"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> <?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'), PHP_EOL; ?>
<a href="https://www.mozilla.org/firefox/">Firefox</a>, <a href="https://www.mozilla.org/firefox/">Firefox</a>,
<a href="https://www.opera.com/">Opera</a>, <a href="https://www.opera.com/">Opera</a>,
<a href="https://www.google.com/chrome">Chrome</a>, <a href="https://www.google.com/chrome">Chrome</a>,
@ -284,7 +284,7 @@ endif;
if (strlen($URLSHORTENER)): if (strlen($URLSHORTENER)):
?> ?>
<button id="shortenbutton" data-shortener="<?php echo htmlspecialchars($URLSHORTENER); ?>" type="button" class="btn btn-primary"> <button id="shortenbutton" data-shortener="<?php echo htmlspecialchars($URLSHORTENER); ?>" type="button" class="btn btn-primary">
<span class="glyphicon glyphicon-send" aria-hidden="true"></span> <?php echo I18n::_('Shorten URL'); ?> <span class="glyphicon glyphicon-send" aria-hidden="true"></span> <?php echo I18n::_('Shorten URL'), PHP_EOL; ?>
</button> </button>
<?php <?php
endif; endif;
@ -317,7 +317,7 @@ endif;
<h4 class="col-md-5 col-xs-8"><?php echo I18n::_('PrivateBin'); ?> <small>- <?php echo I18n::_('Because ignorance is bliss'); ?></small></h4> <h4 class="col-md-5 col-xs-8"><?php echo I18n::_('PrivateBin'); ?> <small>- <?php echo I18n::_('Because ignorance is bliss'); ?></small></h4>
<p class="col-md-1 col-xs-4 text-center"><?php echo $VERSION; ?></p> <p class="col-md-1 col-xs-4 text-center"><?php echo $VERSION; ?></p>
<p id="aboutbox" class="col-md-6 col-xs-12"> <p id="aboutbox" class="col-md-6 col-xs-12">
<?php echo I18n::_('PrivateBin 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://github.com/PrivateBin/PrivateBin/wiki">project page</a>.'); ?> <?php echo I18n::_('PrivateBin 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://github.com/PrivateBin/PrivateBin/wiki">project page</a>.'), PHP_EOL; ?>
</p> </p>
</div> </div>
</footer> </footer>

View File

@ -65,7 +65,7 @@ endif;
<h3 class="title"><?php echo $VERSION; ?></h3> <h3 class="title"><?php echo $VERSION; ?></h3>
<noscript><div id="noscript" class="nonworking"><?php echo I18n::_('Javascript is required for PrivateBin to work.<br />Sorry for the inconvenience.'); ?></div></noscript> <noscript><div id="noscript" class="nonworking"><?php echo I18n::_('Javascript is required for PrivateBin to work.<br />Sorry for the inconvenience.'); ?></div></noscript>
<div id="oldienotice" class="nonworking"><?php echo I18n::_('PrivateBin requires a modern browser to work.'); ?></div> <div id="oldienotice" class="nonworking"><?php echo I18n::_('PrivateBin requires a modern browser to work.'); ?></div>
<div id="ienotice"><?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'); ?> <div id="ienotice"><?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'), PHP_EOL; ?>
<a href="https://www.mozilla.org/firefox/">Firefox</a>, <a href="https://www.mozilla.org/firefox/">Firefox</a>,
<a href="https://www.opera.com/">Opera</a>, <a href="https://www.opera.com/">Opera</a>,
<a href="https://www.google.com/chrome">Chrome</a>, <a href="https://www.google.com/chrome">Chrome</a>,
@ -104,7 +104,7 @@ endforeach;
</div> </div>
<div id="remainingtime" class="hidden"></div> <div id="remainingtime" class="hidden"></div>
<div id="burnafterreadingoption" class="button hidden"> <div id="burnafterreadingoption" class="button hidden">
<input type="checkbox" id="burnafterreading" name="burnafterreading" <?php <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
if ($BURNAFTERREADINGSELECTED): if ($BURNAFTERREADINGSELECTED):
?> checked="checked"<?php ?> checked="checked"<?php
endif; endif;
@ -115,7 +115,7 @@ endif;
if ($DISCUSSION): if ($DISCUSSION):
?> ?>
<div id="opendisc" class="button hidden"> <div id="opendisc" class="button hidden">
<input type="checkbox" id="opendiscussion" name="opendiscussion" <?php <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
if ($OPENDISCUSSION): if ($OPENDISCUSSION):
?> checked="checked"<?php ?> checked="checked"<?php
endif; endif;

View File

@ -114,10 +114,9 @@ class FilesystemTest extends PHPUnit_Framework_TestCase
public function testCommentErrorDetection() public function testCommentErrorDetection()
{ {
$this->_model->delete(Helper::getPasteId()); $this->_model->delete(Helper::getPasteId());
$paste = Helper::getPaste();
$comment = Helper::getComment(array('formatter' => "Invalid UTF-8 sequence: \xB1\x31")); $comment = Helper::getComment(array('formatter' => "Invalid UTF-8 sequence: \xB1\x31"));
$this->assertFalse($this->_model->exists(Helper::getPasteId()), 'paste does not yet exist'); $this->assertFalse($this->_model->exists(Helper::getPasteId()), 'paste does not yet exist');
$this->assertTrue($this->_model->create(Helper::getPasteId(), Helper::getPaste()) === true, 'store new paste'); $this->assertTrue($this->_model->create(Helper::getPasteId(), Helper::getPaste()), 'store new paste');
$this->assertTrue($this->_model->exists(Helper::getPasteId()), 'paste exists after storing it'); $this->assertTrue($this->_model->exists(Helper::getPasteId()), 'paste exists after storing it');
$this->assertFalse($this->_model->existsComment(Helper::getPasteId(), Helper::getPasteId(), Helper::getCommentId()), 'comment does not yet exist'); $this->assertFalse($this->_model->existsComment(Helper::getPasteId(), Helper::getPasteId(), Helper::getCommentId()), 'comment does not yet exist');
$this->assertFalse($this->_model->createComment(Helper::getPasteId(), Helper::getPasteId(), Helper::getCommentId(), $comment), 'unable to store broken comment'); $this->assertFalse($this->_model->createComment(Helper::getPasteId(), Helper::getPasteId(), Helper::getCommentId(), $comment), 'unable to store broken comment');