From bb6a44ce7a5d6181fe54135ecb472f09e4202170 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Tue, 13 Oct 2020 07:28:35 +0200 Subject: [PATCH] remove double translation, avoid unsupported double quotes in INI file --- cfg/conf.sample.php | 3 ++- lib/Configuration.php | 2 +- lib/Controller.php | 2 +- tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- tst/ViewTest.php | 1 + 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cfg/conf.sample.php b/cfg/conf.sample.php index f3254ce..e958c88 100644 --- a/cfg/conf.sample.php +++ b/cfg/conf.sample.php @@ -40,7 +40,8 @@ sizelimit = 10485760 template = "bootstrap" ; (optional) info text to display -;info = "More information on the project page." +; use single, instead of double quotes for HTML attributes +;info = "More information on the project page." ; (optional) notice to display ; notice = "Note: This is a test service: Data may be deleted anytime. Kittens will die if you abuse this service." diff --git a/lib/Configuration.php b/lib/Configuration.php index 962d023..b598326 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -48,7 +48,7 @@ class Configuration 'syntaxhighlightingtheme' => null, 'sizelimit' => 10485760, 'template' => 'bootstrap', - 'info' => 'More information on the project page.', + 'info' => 'More information on the project page.', 'notice' => '', 'languageselection' => false, 'languagedefault' => '', diff --git a/lib/Controller.php b/lib/Controller.php index b1e2175..65243aa 100644 --- a/lib/Controller.php +++ b/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')); diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index deae4cd..e476a87 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -578,7 +578,7 @@ endif;

-

- in the browser using 256 bits AES.', I18n::_($NAME)), ' ', I18n::_($INFO), PHP_EOL; ?> + in the browser using 256 bits AES.', I18n::_($NAME)), ' ', $INFO, PHP_EOL; ?>

diff --git a/tpl/page.php b/tpl/page.php index 2c4e825..f960557 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -76,7 +76,7 @@ endif;
- in the browser using 256 bits AES.', I18n::_($NAME)), ' ', I18n::_($INFO); ?>
+ in the browser using 256 bits AES.', I18n::_($NAME)), ' ', $INFO; ?>
diff --git a/tst/ViewTest.php b/tst/ViewTest.php index 6153052..c729b4e 100644 --- a/tst/ViewTest.php +++ b/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()));