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());
}
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)

Loading…
Cancel
Save