The strict type checking was causing trouble. In any case, forcing arrays to

NOT mix integer and string keys is a good workaround.
This commit is contained in:
defacer 2005-04-10 09:19:28 +00:00
parent 25290a82c6
commit fdae5b1314

View File

@ -652,9 +652,7 @@ function choose_from_menu ($options, $name, $selected='', $nothing='choose', $sc
if (!empty($options)) {
foreach ($options as $value => $label) {
$output .= ' <option value="'. $value .'"';
// The gettype() calls are there because otherwise a numeric zero key is a match for any string value
// As gettype() is possibly expensive, only run the check if the simple equality holds true
if ($value == $selected && gettype($value) == gettype($selected)) {
if ($value == $selected) {
$output .= ' selected="selected"';
}
if ($label === '') {