From 187450900216af83ab19c65b1e4f817f25087f55 Mon Sep 17 00:00:00 2001
From: "Committo,Ergo:sum" <esj@rezo.net>
Date: Sat, 7 Apr 2007 07:50:27 +0000
Subject: [PATCH] =?UTF-8?q?Le=20d=C3=A9busqueur=20sur=20des=20boucles=20qu?=
 =?UTF-8?q?i=20avait=20du=20texte=20en=20langue=20de=20droite=20=C3=A0=20g?=
 =?UTF-8?q?auche=20partait=20=C3=A0=20l'ouest,=20depuis=20toujours.=20Main?=
 =?UTF-8?q?tenant=20c'est=20bon.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ecrire/public/compiler.php | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/ecrire/public/compiler.php b/ecrire/public/compiler.php
index c0d0b39aea..8b42255f40 100644
--- a/ecrire/public/compiler.php
+++ b/ecrire/public/compiler.php
@@ -211,16 +211,17 @@ function calculer_boucle_nonrec($id_boucle, &$boucles) {
 			OR $type_boucle == 'breves'
 			)))
 	  {
-	      $corps .= 
+		// Memoriser la langue avant la boucle et la restituer apres
+	        // afin que le corps de boucle affecte la globale directement
+		$init = "\n	lang_select(\$GLOBALS['spip_lang']);";
+		$fin = "\n	lang_select();";
+
+		$corps .= 
 		  (($boucle->lang_select != 'oui') ? 
 			"\t\tif (!\$GLOBALS['forcer_lang'])\n\t " : '')
-		  . "\t\t\$GLOBALS['spip_lang'] = (\$x = "
+		  . "\t\tif (\$x = "
 		  . index_pile($id_boucle, 'lang', $boucles)
-		  . ') ? $x : $old_lang;';
-		// Memoriser la langue avant la boucle pour la restituer apres
-	      $init = "\n	\$old_lang = \$GLOBALS['spip_lang'];";
-	      $fin = "\n	\$GLOBALS['spip_lang'] = \$old_lang;";
-
+		  . ') $GLOBALS["spip_lang"] = $x;';
 	  }
 	else {
 		$init = '';
-- 
GitLab