PARAM_BOOL now detects on and off values

This commit is contained in:
skodak
2005-11-15 23:20:59 +00:00
parent d50bb68692
commit c635c9c087
+8 -1
View File
@@ -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