8000 [Debug] HTML-escape array key · symfony/symfony@5584e99 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5584e99

Browse files
committed
[Debug] HTML-escape array key
1 parent 347cd87 commit 5584e99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Debug/ExceptionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function setHandler($handler)
9494
*
9595
* @param string $format The format for links to source files
9696
*
97-
* @return string The previous file link format.
97+
* @return string the previous file link format
9898
*/
9999
public function setFileLinkFormat($format)
100100
{
@@ -418,7 +418,7 @@ private function formatArgs(array $args)
418418
$formattedValue = str_replace("\n", '', var_export($this->escapeHtml((string) $item[1]), true));
419419
}
420420

421-
$result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue);
421+
$result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $this->escapeHtml($key), $formattedValue);
422422
}
423423

424424
return implode(', ', $result);

0 commit comments

Comments
 (0)
0