summaryrefslogtreecommitdiff
path: root/lib/action.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-29 11:16:02 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-29 11:16:02 -0400
commitb153ac5b1b1f8849e1ba06d8c0f95eece855fa7b (patch)
tree58c146bde1e494124a169ec3d0ccfa9f73f2556d /lib/action.php
parent9bb55af26f47d960cc33b02ec355d832d18b31b7 (diff)
fix checking boolean parameters
darcs-hash:20080529151602-84dde-f6bc3c41846d92c94008f721fa5115907fd9a7d3.gz
Diffstat (limited to 'lib/action.php')
-rw-r--r--lib/action.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/action.php b/lib/action.php
index 67eaf9ed7..dae50e6e3 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -50,12 +50,12 @@ class Action { // lawsuit
function boolean($key, $def=false) {
$arg = $this->arg($key);
return (is_null($arg)) ? $def :
- (strcasecmp($arg, 'true')) ? true :
- (strcasecmp($arg, 'yes')) ? true :
- (strcasecmp($arg, '1')) ? true :
- (strcasecmp($arg, 'false')) ? false :
- (strcasecmp($arg, 'no')) ? false :
- (strcasecmp($arg, '0')) ? false :
+ (strcasecmp($arg, 'true') == 0) ? true :
+ (strcasecmp($arg, 'yes') == 0) ? true :
+ (strcasecmp($arg, '1') == 0) ? true :
+ (strcasecmp($arg, 'false') == 0) ? false :
+ (strcasecmp($arg, 'no') == 0) ? false :
+ (strcasecmp($arg, '0') == 0) ? false :
$def;
}
}