From bf3dac05d10ffb18854e73e823a83503099aa77d Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sun, 28 Oct 2012 13:27:13 +0100 Subject: [PATCH] added functions for printing escaped and unescaped values --- lib/template.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/template.php b/lib/template.php index 972d75807c7..1ad47cbe52c 100644 --- a/lib/template.php +++ b/lib/template.php @@ -21,6 +21,22 @@ * */ +/** + * Prints an XSS escaped string + * @param string $string the string which will be escaped and printed + */ +function p($string){ + print(OC_Util::sanitizeHTML($string)); +} + +/** + * Prints an unescaped string + * @param string $string the string which will be printed as it is + */ +function print_unescaped($string){ + print($string); +} + /** * @brief make OC_Helper::linkTo available as a simple function * @param string $app app