From cee1f660eb758748cc80982ab5138e45fff8b37e Mon Sep 17 00:00:00 2001
From: "Committo,Ergo:sum" <esj@rezo.net>
Date: Sun, 28 May 2006 15:34:38 +0000
Subject: [PATCH] =?UTF-8?q?Je=20me=20disais=20bien=20que=20[6423]=C2=A0dev?=
 =?UTF-8?q?ait=20etre=20bancale.=20Merci=20Paolo,=20et=20d=C3=A9sol=C3=A9?=
 =?UTF-8?q?=20pour=20ces=20apostrophes=20en=20trop.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ecrire/public/compiler.php | 2 +-
 ecrire/public/criteres.php | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/ecrire/public/compiler.php b/ecrire/public/compiler.php
index 36177fd7f7..960677d88f 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 95215a785f..11d5319913 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);";
 		}
 	}
 
-- 
GitLab