From: pdontthink Date: Sat, 5 Jan 2008 07:34:17 +0000 (+0000) Subject: Form values come to PHP as strings, so default comparison should be consistent X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=07190b29a0ffa194346e59bc5132523dda2025c9;hp=b729dba8fb1c5c3993f64ea4b4b2b48010afdaba Form values come to PHP as strings, so default comparison should be consistent git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12855 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/templates/default/select.tpl b/templates/default/select.tpl index e47349c5..97e48cdf 100644 --- a/templates/default/select.tpl +++ b/templates/default/select.tpl @@ -63,7 +63,7 @@ foreach ($aValues as $key => $value) { // if ($multiple) { foreach ($default as $def) { - if ($def === $key) { + if ((string)$def == (string)$key) { echo ' selected="selected"'; break; } @@ -74,7 +74,7 @@ foreach ($aValues as $key => $value) { // (we could use the same code above, but we do this here to increase // efficency and performance) // - else if ($default[0] === $key) + else if ((string)$default[0] == (string)$key) echo ' selected="selected"'; echo '>' . $label_open . $value . $label_close . "\n";