From 9ab62ad5b787d44238c842f633fc950918aaa796 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 27 Aug 2014 17:01:51 +0200 Subject: [PATCH] Escape error messages --- lib/private/template.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/private/template.php b/lib/private/template.php index eaa58b769d7..173345cc001 100644 --- a/lib/private/template.php +++ b/lib/private/template.php @@ -272,19 +272,19 @@ class OC_Template extends \OC\Template\Base { if (defined('DEBUG') and DEBUG) { $hint = $exception->getTraceAsString(); if (!empty($hint)) { - $hint = '
'.$hint.'
'; + $hint = '
'.OC_Util::sanitizeHTML($hint).'
'; } while (method_exists($exception, 'previous') && $exception = $exception->previous()) { $error_msg .= '
Caused by:' . ' '; if ($exception->getCode()) { - $error_msg .= '['.$exception->getCode().'] '; + $error_msg .= '['.OC_Util::sanitizeHTML($exception->getCode()).'] '; } - $error_msg .= $exception->getMessage(); + $error_msg .= OC_Util::sanitizeHTML($exception->getMessage()); }; } else { $hint = ''; if ($exception instanceof \OC\HintException) { - $hint = $exception->getHint(); + $hint = OC_Util::sanitizeHTML($exception->getHint()); } } self::printErrorPage($error_msg, $hint); -- 2.39.5