PARAM_BOOL now detects on and off values
This commit is contained in:
+8
-1
@@ -238,7 +238,14 @@ function clean_param($param, $options) {
|
||||
}
|
||||
|
||||
if ($options & PARAM_BOOL) { // Convert to 1 or 0
|
||||
$param = empty($param) ? 0 : 1;
|
||||
$tempstr = strtolower($param);
|
||||
if ($tempstr == 'on') {
|
||||
$param = 1;
|
||||
} else if ($tempstr == 'off') {
|
||||
$param = 0;
|
||||
} else {
|
||||
$param = empty($param) ? 0 : 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($options & PARAM_NOTAGS) { // Strip all tags completely
|
||||
|
||||
Reference in New Issue
Block a user