diff --git a/Sources/Subs-Compat.php b/Sources/Subs-Compat.php index f70c3d0182..3bc002da5c 100644 --- a/Sources/Subs-Compat.php +++ b/Sources/Subs-Compat.php @@ -5158,7 +5158,7 @@ function loadJavaScriptFile(string $fileName, array $params = [], string $id = ' SMF\Theme::loadJavaScriptFile($fileName, $params, $id); } - function addJavaScriptVar(string $key, string $value, bool $escape = false) + function addJavaScriptVar(string $key, mixed $value, bool $escape = false) { return SMF\Theme::addJavaScriptVar($key, $value, $escape); } diff --git a/Sources/Theme.php b/Sources/Theme.php index 2dca28506c..dc5be92a33 100644 --- a/Sources/Theme.php +++ b/Sources/Theme.php @@ -661,10 +661,10 @@ public static function loadJavaScriptFile(string $fileName, array $params = [], * This is cleaner and easier for modders than Theme::addInlineJavaScript(). * * @param string $key The key for this variable - * @param string $value The value + * @param mixed $value The value * @param bool $escape Whether or not to escape the value */ - public static function addJavaScriptVar(string $key, string $value, bool $escape = false): void + public static function addJavaScriptVar(string $key, mixed $value, bool $escape = false): void { // Variable name must be a valid string. if (!is_string($key) || $key === '' || is_numeric($key)) {