Skip to content

Commit

Permalink
Escape error messages
Browse files Browse the repository at this point in the history
Some variables must be escaped because they contain non-alphanumeric
characters which can break the message formatting, layout, or make
sections invisible, which makes error messages confusing.
  • Loading branch information
ThomasBrierley committed Sep 27, 2024
1 parent b682512 commit 61ea342
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/UI/Output.php
Original file line number Diff line number Diff line change
Expand Up @@ -1239,15 +1239,15 @@ public static function safe_var_dump($x) {
self::safe_var_cleanup($x, 0);
var_dump($x);
$result = ob_get_clean();
return $result;
return htmlent_utf8($result);
}

public static function safe_print_r($x) {
ob_start();
self::safe_var_cleanup($x, 0);
print_r($x);
$result = ob_get_clean();
return $result;
return htmlent_utf8($result);
}

public static function htmlError($message,$detail,$next=false) {
Expand Down

0 comments on commit 61ea342

Please sign in to comment.