diff --git a/inc-compilo.php3 b/inc-compilo.php3
index 830d4e0217aeef6c289514756dd132c1beaef8d8..9294ff97a65dafb385eeba3fda04d4a1ec00b371 100644
--- a/inc-compilo.php3
+++ b/inc-compilo.php3
@@ -125,8 +125,10 @@ function calculer_boucle($id_boucle, &$boucles) {
 		    ")")) .
 		  "] = 1; // invalideurs\n";
 
+	// faudrait expanser le foreach a la compil, car y en a souvent qu'un 
+	// et puis faire un [] plutot qu'un "','."
 	if ($boucle->doublons)
-		$corps .= "		\$doublons[".$boucle->doublons."] .= ','. " .
+		$corps .= "		foreach(" . $boucle->doublons . ' as $k) $doublons[$k]= "," . ' .
 		index_pile($id_boucle, $primary, $boucles)
 		. "; // doublons\n";
 
diff --git a/inc-criteres.php3 b/inc-criteres.php3
index 08b35beeb8c0358e90961e75e42d6528456d6c22..e29e3a406eb4f0f6339a762907b4b2d0be3d83bf 100644
--- a/inc-criteres.php3
+++ b/inc-criteres.php3
@@ -55,8 +55,8 @@ function critere_doublons_dist($idb, &$boucles, $crit) {
 	  "calcul_mysql_in('".$boucle->id_table . '.' . $boucle->primary .
 	  "', " .
 	  '"0".$doublons[' . 
-	  $boucle->doublons .
-	  " = ('" .
+	  ($crit->not ? '' : ($boucle->doublons . "[]= ")) .
+	  "('" .
 	  $boucle->type_requete . 
 	  "' . " .
 	  calculer_liste($crit->param[0], array(), $boucles, $boucles[$idb]->id_parent) .
diff --git a/inc-html-squel.php3 b/inc-html-squel.php3
index 9afd68889e1be41a043b155d77e9f47b4588be54..f6682e251a4d0d2accb2254c459135b5e4af99b7 100644
--- a/inc-html-squel.php3
+++ b/inc-html-squel.php3
@@ -335,7 +335,7 @@ function phraser_criteres($params, &$result) {
 
 	$args = array();
 	$type = $result->type_requete;
-	$doublons = "";
+	$doublons = array();
 	foreach($params as $v) {
 		$var = $v[1][0];
 		$param = ($var->type != 'texte') ? "" : $var->texte;
@@ -440,11 +440,8 @@ function phraser_criteres($params, &$result) {
 			  }
 			  if ((!ereg('^!?doublons *', $param)) || $crit->not)
 			    $args[] = $crit;
-			  elseif (!$doublons)
-			    $doublons = $crit;
 			  else 
-			    erreur_squelette(_T('zbug_critere_inconnu',
-						array('critere' => '2 doublons')));
+			    $doublons[] = $crit;
 			}
 		  }
 		}
@@ -452,7 +449,7 @@ function phraser_criteres($params, &$result) {
 	// les doublons non nies doivent etre le dernier critere
 	// pour que la variable $doublon_index ait la bonne valeur
 	// cf critere_doublon
-	if ($doublons) $args[] = $doublons;
+	if ($doublons) $args= array_merge($args, $doublons);
 	$result->criteres = $args;
 }