From 6ea6b52cf9ea15528f5e7d3f94f68b4becd45e45 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 02:50:13 +0100 Subject: [PATCH] Fix: Ensure string type for urlencode() --- htdocs/contact/consumption.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 67714ae131e..66067b00e6e 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -368,7 +368,7 @@ $param .= "&month=".urlencode($month); $param .= "&year=".urlencode($year); $param .= "&sprod_fulldescr=".urlencode($sprod_fulldescr); if (!empty($socid)) { - $param .= "&socid=".urlencode($socid); + $param .= "&socid=".urlencode((string) ($socid)); } $param .= "&type_element=".urlencode($type_element); @@ -382,7 +382,7 @@ if ($sql_select) { $num = $db->num_rows($resql); - $param = (!empty($socid) ? "&socid=".urlencode($socid) : "")."&type_element=".urlencode($type_element)."&id=".urlencode($id); + $param = (!empty($socid) ? "&socid=".urlencode((string) ($socid)) : "")."&type_element=".urlencode((string) ($type_element))."&id=".urlencode((string) ($id)); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } @@ -396,10 +396,10 @@ if ($sql_select) { $param .= "&sref=".urlencode($sref); } if ($month) { - $param .= "&month=".urlencode($month); + $param .= "&month=".urlencode((string) ($month)); } if ($year) { - $param .= "&year=".urlencode($year); + $param .= "&year=".urlencode((string) ($year)); } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss);