}
}
+ function trimmed($key) {
+ $arg = $this->arg($key);
+ return (is_string($arg)) ? trim($arg) : $arg;
+ }
+
function handle($argarray) {
+ $strip = get_magic_quotes_gpc();
$this->args = array();
foreach ($argarray as $k => $v) {
- $this->args[$k] = $v;
+ $this->args[$k] = ($strip) ? stripslashes($v) : $v;
}
}
+
+ 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 :
+ $def;
+ }
}