From 56011a1b1093c80e0904a6c14865a16211e57d5b Mon Sep 17 00:00:00 2001 From: pzinovkin Date: Tue, 23 Dec 2008 13:19:29 +0000 Subject: [PATCH] escape now can work whith arrays git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@33 4cb57b5f-5bbd-dd11-951b-001d605cbbc5 --- classes/Model.class.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/classes/Model.class.php b/classes/Model.class.php index c82decf..00ebefb 100644 --- a/classes/Model.class.php +++ b/classes/Model.class.php @@ -66,13 +66,19 @@ abstract class Model } /** - * Экранирует строку - * - * @param string $data - строка для экранирования - * @return string - */ + * Экранирует строку + * + * @param mixed $data - строка для экранирования + * @return mixed + */ function escape($data) { + if(is_array($data)){ + foreach($data as $id => $val){ + $data[$id] = mysqli_real_escape_string($this->handler, $val); + } + return $data; + } return mysqli_real_escape_string($this->handler, $data); }