From 73a67e0ab22669a2d3d2950d0e6aae5f2083c6b9 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 6 Aug 2025 12:45:49 +0200 Subject: [PATCH 1/2] Fix warnings --- htdocs/core/class/html.formother.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 5f75c61f0ab..73883bba657 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1080,7 +1080,7 @@ class FormOther /** * Return HTML combo list of month * - * @param string $selected Preselected value + * @param int|string $selected Preselected value * @param string $htmlname Name of HTML select object * @param int $useempty Show empty in list * @param int $longlabel Show long label (1) or short label (0) @@ -1096,9 +1096,9 @@ class FormOther require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if ($longlabel) { - $montharray = monthArray($langs, 0); // Get array + $montharray = monthArray($langs, 0); // Get array of month with long labels } else { - $montharray = monthArray($langs, 1); + $montharray = monthArray($langs, 1); // Get array of month with short labels } $select_month = ''; if ($useempty) { $selected_html = ''; - if ($selected == '') { + if ((string) $selected == '') { $selected_html = ' selected'; } $out .= ''; @@ -1186,7 +1186,7 @@ class FormOther if (!$invert) { for ($y = $max_year; $y >= $min_year; $y--) { $selected_html = ''; - if ($selected > 0 && $y == $selected) { + if ((int) $selected > 0 && $y == (int) $selected) { $selected_html = ' selected'; } $out .= ''; @@ -1194,7 +1194,7 @@ class FormOther } else { for ($y = $min_year; $y <= $max_year; $y++) { $selected_html = ''; - if ($selected > 0 && $y == $selected) { + if ((int) $selected > 0 && $y == (int) $selected) { $selected_html = ' selected'; } $out .= '';