From ec8da707e4e3ba46e34e7b3a40577c8bba2cd1d2 Mon Sep 17 00:00:00 2001 From: Fil <fil@rezo.net> Date: Mon, 23 Aug 2004 23:14:58 +0000 Subject: [PATCH] bug mechant (requete SQL invalide) --- inc-forum.php3 | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/inc-forum.php3 b/inc-forum.php3 index 9a70fe7b12..306e471cd9 100644 --- a/inc-forum.php3 +++ b/inc-forum.php3 @@ -197,16 +197,14 @@ VALUES (NOW(), \"".addslashes($titre)."\", \"$REMOTE_ADDR\", \"redac\") } function table_des_mots($table, $les_mots) { - global $afficher_groupe; + global $afficher_groupe; + + if ($afficher_groupe) + $in_group = " AND id_groupe IN (" . join($afficher_groupe, ", ") .")"; + + $result_groupe = spip_query("SELECT * FROM spip_groupes_mots + WHERE 6forum = 'oui' AND $table = 'oui'". $in_group); - $result_groupe = spip_query(" -SELECT * -FROM spip_groupes_mots -WHERE 6forum = 'oui' -AND $table = 'oui' " . ((!$afficher_groupe) ? '' : (" -AND id_groupe IN (" . join($afficher_groupe, ", "))) -); - $ret = ''; while ($row_groupe = spip_fetch_array($result_groupe)) { $id_groupe = $row_groupe['id_groupe']; -- GitLab