inc-forum.php3 1.77 1.78

Update of /home/spip-cvs/spip
In directory alan:/tmp/cvs-serv16730

Modified Files:
  inc-forum.php3
Log Message:
bug mechant (requete SQL invalide)

Index: inc-forum.php3

RCS file: /home/spip-cvs/spip/inc-forum.php3,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- inc-forum.php3 16 Aug 2004 17:37:33 -0000 1.77
+++ inc-forum.php3 23 Aug 2004 23:14:58 -0000 1.78
@@ -197,16 +197,14 @@
}

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'];