From caeb4d7137efe317ff0d62b67cf7a58634d0fc5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=B2=D0=B8=D0=B4=20=D0=9C=D0=B7=D0=B0=D1=80?= =?UTF-8?q?=D0=B5=D1=83=D0=BB=D1=8F=D0=BD?= Date: Sun, 16 Dec 2012 20:53:45 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D0=B0=D1=8F=20=D1=81=D0=B8?= =?UTF-8?q?=D0=B3=D0=BD=D0=B0=D1=82=D1=83=D1=80=D0=B0=20whiteList()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Новая сигнатура whiteList — со значением по умолчанию --- safemysql.class.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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)