diff --git a/app/Utils.inc b/app/Utils.inc index 1e3527c1..76ccc7fe 100644 --- a/app/Utils.inc +++ b/app/Utils.inc @@ -19,6 +19,33 @@ */ class Utils { + + + /** + * Mask HTML-chars for save output. + * + * @static + * @param string $string String to be masked + * @return string Masked string + */ + static function t($string) + { + return nl2br(htmlspecialchars($string)); + } + + + /** + * ‚htmlspecialchars‘ with support for UTF-8. + * + * @static + * @param string $string String to be masked + * @return string Masked string + */ + public static function htmlspecialchars_utf8($string) + { + return htmlspecialchars($string, ENT_COMPAT, 'UTF-8'); + } + } ?> diff --git a/views/html/questgroups/questgroup.tpl b/views/html/questgroups/questgroup.tpl index b78d1fe4..5699bfa7 100644 --- a/views/html/questgroups/questgroup.tpl +++ b/views/html/questgroups/questgroup.tpl @@ -6,7 +6,7 @@
=$text['text']?>
+=\hhu\z\Utils::t($text['text'])?>
diff --git a/views/html/quests/quest.tpl b/views/html/quests/quest.tpl index afccd176..9a8b7376 100644 --- a/views/html/quests/quest.tpl +++ b/views/html/quests/quest.tpl @@ -10,7 +10,7 @@=$questtext['text']?>
+=\hhu\z\Utils::t($questtext['text'])?>
=$quest['task']?>
+=\hhu\z\Utils::t($quest['task'])?>
=$sidequesttext['text']?>
+=\hhu\z\Utils::t($sidequesttext['text'])?>
@@ -33,6 +33,6 @@=$sidequest['task']?>
+=\hhu\z\Utils::t(($sidequest['task'])?>
=$seminary['description']?>
+=\hhu\z\Utils::t($seminary['description'])?>