From 8cc857c7ab92d78572877b5cf44fe19eff319159 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 3 Jul 2010 19:04:11 +0200 Subject: [PATCH] Prevents potential wrong query. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- include/validations/entreprises.inc.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/validations/entreprises.inc.php b/include/validations/entreprises.inc.php index bf60594..47e6a02 100644 --- a/include/validations/entreprises.inc.php +++ b/include/validations/entreprises.inc.php @@ -68,12 +68,14 @@ class EntrReq extends ProfileValidate $where .= "name LIKE '%" . $name_array[$i] . "%'"; } } - $res = XDB::iterator('SELECT name - FROM profile_job_enum - WHERE ' . $where); - $this->suggestions = "| "; - while ($sug = $res->next()) { - $this->suggestions .= $sug['name'] . " | "; + if ($where != '') { + $res = XDB::iterator('SELECT name + FROM profile_job_enum + WHERE ' . $where); + $this->suggestions = "| "; + while ($sug = $res->next()) { + $this->suggestions .= $sug['name'] . " | "; + } } } -- 2.1.4