Commit 7bd2a58e authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix: View::e() accept mixed type to handle int/null IDs from APIs

Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 0402e2b4
...@@ -81,12 +81,12 @@ class View ...@@ -81,12 +81,12 @@ class View
return MODULES_PATH . "/{$view}.php"; return MODULES_PATH . "/{$view}.php";
} }
public static function escape(?string $value): string public static function escape(mixed $value): string
{ {
return htmlspecialchars($value ?? '', ENT_QUOTES, 'UTF-8'); return htmlspecialchars((string)($value ?? ''), ENT_QUOTES, 'UTF-8');
} }
public static function e(?string $value): string public static function e(mixed $value): string
{ {
return self::escape($value); return self::escape($value);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment