Form values come to PHP as strings, so default comparison should be consistent
[squirrelmail.git] / templates / default / select.tpl
index e47349c589f8b9a9649b89228bf6411a278cf9d6..97e48cdf1207a1ea0f5df5a590c6e515f61ec6c8 100644 (file)
@@ -63,7 +63,7 @@ foreach ($aValues as $key => $value) {
     //
     if ($multiple) {
         foreach ($default as $def) {
     //
     if ($multiple) {
         foreach ($default as $def) {
-            if ($def === $key) {
+            if ((string)$def == (string)$key) {
                 echo ' selected="selected"';
                 break;
             }
                 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)
     //
     // (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  . "</option>\n";
         echo ' selected="selected"';
 
     echo '>' . $label_open . $value . $label_close  . "</option>\n";