From 8159cc99a64cfe563dccea6821348764fc40fb85 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Mon, 24 Feb 2014 18:29:09 -0500 Subject: Improve HTML escaping --- lib/translator.php | 6 ++++-- templates/board_remove.php | 2 +- templates/config_index.php | 9 ++++++--- templates/project_remove.php | 2 +- templates/user_index.php | 2 +- templates/user_remove.php | 2 +- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/translator.php b/lib/translator.php index d9d9a84a..75d40a23 100644 --- a/lib/translator.php +++ b/lib/translator.php @@ -11,6 +11,10 @@ namespace Translator { \array_shift($args); \array_unshift($args, get($identifier, $identifier)); + foreach ($args as &$arg) { + $arg = htmlspecialchars($arg, ENT_QUOTES, 'UTF-8', false); + } + return \call_user_func_array( 'sprintf', $args @@ -77,7 +81,6 @@ namespace Translator { foreach ($dir as $fileinfo) { if (strpos($fileinfo->getFilename(), '.php') !== false) { - $locales = array_merge($locales, include $fileinfo->getPathname()); } } @@ -91,7 +94,6 @@ namespace Translator { static $values = array(); if ($locales !== null) { - $values = $locales; } diff --git a/templates/board_remove.php b/templates/board_remove.php index c95c8a28..b406eb38 100644 --- a/templates/board_remove.php +++ b/templates/board_remove.php @@ -5,7 +5,7 @@

- +

diff --git a/templates/config_index.php b/templates/config_index.php index 5012538a..d94ee8b9 100644 --- a/templates/config_index.php +++ b/templates/config_index.php @@ -27,7 +27,10 @@ -
  • +
  • + + +
  • @@ -38,7 +41,7 @@
  • - http://kanboard.net/ + http://kanboard.net/
  • @@ -55,7 +58,7 @@
    • - , + ,
    diff --git a/templates/project_remove.php b/templates/project_remove.php index f63c4031..e9f213b5 100644 --- a/templates/project_remove.php +++ b/templates/project_remove.php @@ -5,7 +5,7 @@

    - +

    diff --git a/templates/user_index.php b/templates/user_index.php index 4b539599..ccc955fc 100644 --- a/templates/user_index.php +++ b/templates/user_index.php @@ -27,7 +27,7 @@ - + diff --git a/templates/user_remove.php b/templates/user_remove.php index e1dc6f7b..a4db2e4a 100644 --- a/templates/user_remove.php +++ b/templates/user_remove.php @@ -4,7 +4,7 @@
    -

    +

    -- cgit v1.2.3