Browse Source

Новая сигнатура whiteList()

Новая сигнатура whiteList — со значением по умолчанию
dev
Давид Мзареулян 13 years ago
parent
commit
caeb4d7137
  1. 11
      safemysql.class.php

11
safemysql.class.php

@ -174,15 +174,10 @@ class SafeMySQL
return $this->prepareQuery(func_get_args()); return $this->prepareQuery(func_get_args());
} }
public function whiteList($input,$allowed,$strict=FALSE) public function whiteList($input,$allowed,$default=FALSE)
{ {
$found = array_search($input); $found = array_search($input,$allowed);
if ($strict && ($found === FALSE)) return ($found === FALSE) ? $default : $allowed[$found];
{
return FALSE;
} else {
return $allowed[$found];
}
} }
public function filterArray($input,$allowed) public function filterArray($input,$allowed)

Loading…
Cancel
Save