Преглед изворни кода

remove double translation, avoid unsupported double quotes in INI file

El RIDO пре 5 година
родитељ
комит
bb6a44ce7a
6 измењених фајлова са 7 додато и 5 уклоњено
  1. 2 1
      cfg/conf.sample.php
  2. 1 1
      lib/Configuration.php
  3. 1 1
      lib/Controller.php
  4. 1 1
      tpl/bootstrap.php
  5. 1 1
      tpl/page.php
  6. 1 0
      tst/ViewTest.php

+ 2 - 1
cfg/conf.sample.php

@@ -40,7 +40,8 @@ sizelimit = 10485760
 template = "bootstrap"
 
 ; (optional) info text to display
-;info = "More information on the <a href=\"https://privatebin.info/\">project page</a>."
+; use single, instead of double quotes for HTML attributes
+;info = "More information on the <a href='https://privatebin.info/'>project page</a>."
 
 ; (optional) notice to display
 ; notice = "Note: This is a test service: Data may be deleted anytime. Kittens will die if you abuse this service."

+ 1 - 1
lib/Configuration.php

@@ -48,7 +48,7 @@ class Configuration
             'syntaxhighlightingtheme'  => null,
             'sizelimit'                => 10485760,
             'template'                 => 'bootstrap',
-            'info'                     => 'More information on the <a href="https://privatebin.info/">project page</a>.',
+            'info'                     => 'More information on the <a href=\'https://privatebin.info/\'>project page</a>.',
             'notice'                   => '',
             'languageselection'        => false,
             'languagedefault'          => '',

+ 1 - 1
lib/Controller.php

@@ -380,7 +380,7 @@ class Controller
         $page->assign('SYNTAXHIGHLIGHTINGTHEME', $this->_conf->getKey('syntaxhighlightingtheme'));
         $page->assign('FORMATTER', $formatters);
         $page->assign('FORMATTERDEFAULT', $this->_conf->getKey('defaultformatter'));
-        $page->assign('INFO', I18n::_($this->_conf->getKey('info')));
+        $page->assign('INFO', I18n::_(str_replace("'", '"', $this->_conf->getKey('info'))));
         $page->assign('NOTICE', I18n::_($this->_conf->getKey('notice')));
         $page->assign('BURNAFTERREADINGSELECTED', $this->_conf->getKey('burnafterreadingselected'));
         $page->assign('PASSWORD', $this->_conf->getKey('password'));

+ 1 - 1
tpl/bootstrap.php

@@ -578,7 +578,7 @@ endif;
 					<h4 class="col-md-5 col-xs-8"><?php echo I18n::_($NAME); ?> <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 id="aboutbox" class="col-md-6 col-xs-12">
-						<?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.', I18n::_($NAME)), ' ', I18n::_($INFO), PHP_EOL; ?>
+						<?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.', I18n::_($NAME)), ' ', $INFO, PHP_EOL; ?>
 					</p>
 				</div>
 			</footer>

+ 1 - 1
tpl/page.php

@@ -76,7 +76,7 @@ endif;
 	<body data-compression="<?php echo rawurlencode($COMPRESSION); ?>">
 		<header>
 			<div id="aboutbox">
-				<?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.', I18n::_($NAME)), ' ', I18n::_($INFO); ?><br />
+				<?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.', I18n::_($NAME)), ' ', $INFO; ?><br />
 <?php
 if (strlen($NOTICE)):
 ?>

+ 1 - 0
tst/ViewTest.php

@@ -49,6 +49,7 @@ class ViewTest extends PHPUnit_Framework_TestCase
         $page->assign('PASSWORD', true);
         $page->assign('FILEUPLOAD', false);
         $page->assign('ZEROBINCOMPATIBILITY', false);
+        $page->assign('INFO', 'example');
         $page->assign('NOTICE', 'example');
         $page->assign('LANGUAGESELECTION', '');
         $page->assign('LANGUAGES', I18n::getLanguageLabels(I18n::getAvailableLanguages()));