diff --git a/safemysql.class.php b/safemysql.class.php index 8e89bed..e94426e 100644 --- a/safemysql.class.php +++ b/safemysql.class.php @@ -174,15 +174,10 @@ class SafeMySQL return $this->prepareQuery(func_get_args()); } - public function whiteList($input,$allowed,$strict=FALSE) + public function whiteList($input,$allowed,$default=FALSE) { - $found = array_search($input); - if ($strict && ($found === FALSE)) - { - return FALSE; - } else { - return $allowed[$found]; - } + $found = array_search($input,$allowed); + return ($found === FALSE) ? $default : $allowed[$found]; } public function filterArray($input,$allowed)