From be9c3da283b99deabcdc9bbdeadf864fb62f27a5 Mon Sep 17 00:00:00 2001 From: campbell-m <87438215+campbell-m@users.noreply.github.com> Date: Sun, 2 Jun 2024 06:41:12 +0100 Subject: [PATCH] Fix potential type errors --- web/lib/MRBS/Form/Element.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/lib/MRBS/Form/Element.php b/web/lib/MRBS/Form/Element.php index 543bbbe097..605dff1210 100644 --- a/web/lib/MRBS/Form/Element.php +++ b/web/lib/MRBS/Form/Element.php @@ -398,7 +398,7 @@ public function toHTML($no_whitespace=false) { // boolean attributes, eg 'required', don't need a value $html .= '="'; - if (is_int($value)) + if (is_numeric($value)) { // No need to escape these $html .= $value; @@ -458,7 +458,7 @@ public function toHTML($no_whitespace=false) private static function escapeText($text, $raw=false) { - if ($raw || is_int($text)) + if ($raw || is_numeric($text)) { return $text; }