From: Stéphane Jacob Date: Sat, 3 Jul 2010 17:04:11 +0000 (+0200) Subject: Prevents potential wrong query. X-Git-Tag: xorg/1.0.1~362 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=8cc857c7ab92d78572877b5cf44fe19eff319159;p=platal.git Prevents potential wrong query. Signed-off-by: Stéphane Jacob --- 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'] . " | "; + } } }