From 636777dc611b28f81970c56afce3f8dfdaea5296 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Wed, 26 Jul 2017 16:58:46 +0200 Subject: [PATCH] [Debug] HTML-escape array key --- src/Symfony/Component/Debug/ExceptionHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Debug/ExceptionHandler.php b/src/Symfony/Component/Debug/ExceptionHandler.php index 0c43ba6a05..e3a58393b8 100644 --- a/src/Symfony/Component/Debug/ExceptionHandler.php +++ b/src/Symfony/Component/Debug/ExceptionHandler.php @@ -94,7 +94,7 @@ class ExceptionHandler * * @param string $format The format for links to source files * - * @return string The previous file link format. + * @return string The previous file link format */ public function setFileLinkFormat($format) { @@ -418,7 +418,7 @@ EOF; $formattedValue = str_replace("\n", '', var_export($this->escapeHtml((string) $item[1]), true)); } - $result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue); + $result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $this->escapeHtml($key), $formattedValue); } return implode(', ', $result);