From a17af6485097050cf65f42fb8834659c680724fe Mon Sep 17 00:00:00 2001
From: Fil <fil@rezo.net>
Date: Sat, 10 Jun 2006 22:08:08 +0000
Subject: [PATCH] =?UTF-8?q?petites=20corrections=20:=20-=20numero=20de=20v?=
 =?UTF-8?q?ersion=20dans=20htaccess=20(yanic)=20-=20un=20log=20en=20trop?=
 =?UTF-8?q?=20-=20indexation=20ne=20parcourait=20pas=20toutes=20les=20tabl?=
 =?UTF-8?q?es=20=C3=A0=20chaque=20tour=20(esj)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ecrire/exec/sites.php     |  1 -
 ecrire/inc/indexation.php | 12 +++++-------
 htaccess.txt              |  2 +-
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/ecrire/exec/sites.php b/ecrire/exec/sites.php
index 8de286a0bd..7e3059b787 100644
--- a/ecrire/exec/sites.php
+++ b/ecrire/exec/sites.php
@@ -108,7 +108,6 @@ if ($analyser_site == 'oui' AND $flag_editable) {
 		$url_syndic = trim($v['url_syndic']);
 		$descriptif = $v['descriptif'];
 		$syndication = $v[syndic] ? 'oui' : 'non';
-spip_log ("UPDATE spip_syndic SET nom_site=" . spip_abstract_quote($nom_site) . ", url_site=" . spip_abstract_quote($url) . ", url_syndic=" . spip_abstract_quote($url_syndic) . ", descriptif=" . spip_abstract_quote($descriptif) . ", syndication='$syndication', statut='$statut' WHERE id_syndic=$id_syndic");
 		$result = spip_query("UPDATE spip_syndic SET nom_site=" . spip_abstract_quote($nom_site) . ", url_site=" . spip_abstract_quote($url) . ", url_syndic=" . spip_abstract_quote($url_syndic) . ", descriptif=" . spip_abstract_quote($descriptif) . ", syndication='$syndication', statut='$statut' WHERE id_syndic=$id_syndic");
 		if ($syndication == 'oui') syndic_a_jour($id_syndic);
 		$redirect = generer_url_ecrire('sites',("id_syndic=$id_syndic". ($redirect ?  "&redirect=$redirect" : "")), true);
diff --git a/ecrire/inc/indexation.php b/ecrire/inc/indexation.php
index e43075076b..39215e633c 100644
--- a/ecrire/inc/indexation.php
+++ b/ecrire/inc/indexation.php
@@ -614,19 +614,17 @@ function critere_optimisation($table) {
 
 function effectuer_une_indexation($nombre_indexations = 1) {
 	global $INDEX_iteration_nb_maxi;
-	// chercher un objet a indexer dans chacune des tables d'objets
 	$vu = array();
-	$tables = liste_index_tables();
 
-	while (list(,$table) = each($tables)) {
-		$table_index = 'spip_index';
-		$table_primary = primary_index_table($table);
+	// chercher un objet a indexer dans chacune des tables d'objets
+	foreach (liste_index_tables() as $table) {
 
+		$table_primary = primary_index_table($table);
 		$critere = critere_indexation($table);
 
 		$limit = $nombre_indexations;
 		if (isset($INDEX_iteration_nb_maxi[$table]))
-		  $limit = min($limit,$INDEX_iteration_nb_maxi[$table]);
+			$limit = min($limit,$INDEX_iteration_nb_maxi[$table]);
 
 		// indexer en priorite les '1' (a reindexer), ensuite les ''
 		// (statut d'indexation inconnu), enfin les 'idx' (ceux dont
@@ -637,7 +635,7 @@ function effectuer_une_indexation($nombre_indexations = 1) {
 				$vu[$table] .= $t['id'].", ";
 				indexer_objet($table, $t['id'], $mode);
 			}
-			if ($vu) break;
+			if ($vu[$table]) break;
 		}
 	}
 	return $vu;
diff --git a/htaccess.txt b/htaccess.txt
index a1c09ad88d..686b500d90 100644
--- a/htaccess.txt
+++ b/htaccess.txt
@@ -1,5 +1,5 @@
 ##############################################################
-# Fichier .htaccess                                SPIP v1.8 #
+# Fichier .htaccess                                SPIP v1.9 #
 #                                                            #
 # Permet de controler les URLs et la version de php utilisee #
 # Compatible avec les URLs 'html', 'propres' et 'propres2'   #
-- 
GitLab