From 0c1b73d6ac56fd23eb8499c21199ecab4717cd20 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Mon, 15 Feb 2021 19:08:56 +0100 Subject: [PATCH] Icons/Names * icon names can contain spaces. So indiscriminate trimming should be discouraged. * ... * unrelated stuff: please don't break... --- includes/utilities.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/utilities.php b/includes/utilities.php index d7062b8d..6f557664 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -666,7 +666,7 @@ class Util return $data; } - return htmlspecialchars(trim($data), ENT_QUOTES, 'utf-8'); + return htmlspecialchars($data, ENT_QUOTES, 'utf-8'); } public static function jsEscape($data) @@ -679,7 +679,7 @@ class Util return $data; } - return strtr(trim($data), array( + return strtr($data, array( '\\' => '\\\\', "'" => "\\'", '"' => '\\"', @@ -809,6 +809,8 @@ class Util return false; else if (!is_array($data)) { + $rawData = $data; // do not transform strings + $data = trim($data); if (preg_match('/^-?\d*,\d+$/', $data)) $data = strtr($data, ',', '.'); @@ -830,6 +832,7 @@ class Util return true; } + $data = $rawData; return false; }