Ouch!
| From: | rasmus@php.net | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Ouch! | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-8880@lists.php.net to get a copy of this message | ||
We nailed ourselves with a compatibility problem on php.net. This
function used to work fine. Now when $state comes from an undefined
argument, it doesn't work anymore. Casting $state to string in the
comparisons fixes it.
function show_state_options($state, $show_all, $user_mode=0) {
if ($state) { echo "<option>$state\n"; }
if($state!="Open") { echo "<option>Open\n"; }
if($state!="Closed") { echo "<option>Closed\n"; }
if($state!="Assigned" && $user_mode!=2) { echo
"<option>Assigned\n"; }
if($state!="Analyzed" && $user_mode!=2) { echo
"<option>Analyzed\n"; }
if($state!="Suspended" && $user_mode!=2) { echo
"<option>Suspended\n"; }
if($state!="Duplicate") { echo "<option>Duplicate\n"; }
if($state!="All" && $show_all) { echo "<option>All\n"; }
}
-Rasmus