diff --git a/ecrire/public/compiler.php b/ecrire/public/compiler.php
index 36177fd7f778ed185a73adf5f305caac496acccd..960677d88f6596e2f7d4b9152ca63fe257efce88 100644
--- a/ecrire/public/compiler.php
+++ b/ecrire/public/compiler.php
@@ -292,7 +292,7 @@ function calculer_dump_array($a)
 {
   if (!is_array($a)) return $a ;
   $res = "";
-  if ($a[0] == "'?'") 
+  if ($a AND $a[0] == "'?'") 
     return ("(" . calculer_dump_array($a[1]) .
 	    " ? " . calculer_dump_array($a[2]) .
 	    " : " . calculer_dump_array($a[3]) .
diff --git a/ecrire/public/criteres.php b/ecrire/public/criteres.php
index 95215a785f4163c87032e2e3475591a533156e0f..11d53199137055d616b063eedf45fa96e46b7a2e 100644
--- a/ecrire/public/criteres.php
+++ b/ecrire/public/criteres.php
@@ -214,6 +214,7 @@ function critere_parinverse($idb, &$boucles, $crit, $sens) {
 
 	foreach ($crit->param as $tri) {
 
+	  $fct = ""; // en cas de fonction SQL
 	// tris specifies dynamiquement
 	  if ($tri[0]->type != 'texte') {
 	      $order = 
@@ -238,7 +239,6 @@ function critere_parinverse($idb, &$boucles, $crit, $sens) {
 		  $boucle->select[] = $texte . " AS $as";
 		  $order = "'$as'";
 	      } else {
-	      $fct = "";
 	      if (!ereg("^" . CHAMP_SQL_PLUS_FONC . '$', $par, $match)) 
 		erreur_squelette(_T('zbug_info_erreur_squelette'), "{par $par} BOUCLE$idb");
 	      else {
@@ -510,9 +510,7 @@ function critere_IN_dist ($idb, &$boucles, $crit)
 		  // on repere l'utilisation brute de #ENV**{X}, 
 		  // c'est-a-dire sa  traduction en ($PILE[0][X]).
 		  // et on deballe mais en rajoutant l'anti XSS
-		  $t = preg_match(",^(\n//.*\n)?\\\$Pile.0,", $v) ? 
-		    "array_map('spip_abstract_quote', $v)" : $v;
-		  $x .= "\n\tif (!(is_array($v)))\n\t\t$var" ."[]= spip_abstract_quote($v);\n\telse $var = array_merge($var, $t);";
+		  $x .= "\n\tif (!(is_array($v)))\n\t\t$var" ."[]= $v;\n\telse $var = array_merge($var, $v);";
 		}
 	}