From 7a7a0ce2e79d4f64feb1945e0102e137bc6e3f67 Mon Sep 17 00:00:00 2001
From: Christian Lefebvre <christian_lefebvre@laposte.net>
Date: Sun, 29 Oct 2006 21:27:46 +0000
Subject: [PATCH] test de version >4.1 ne prenait pas 5.x en compte

---
 ecrire/inc/indexation.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ecrire/inc/indexation.php b/ecrire/inc/indexation.php
index 88d6a09334..8cbbdf2b62 100644
--- a/ecrire/inc/indexation.php
+++ b/ecrire/inc/indexation.php
@@ -754,8 +754,8 @@ function requete_hash ($rech) {
 	// alors qu'en MySQL 4.1 c'est interdit !
 	$vers = spip_query("SELECT VERSION() AS v");
 	$vers = spip_fetch_array($vers);
-	if (substr($vers['v'], 0, 1) >= 4
-	AND substr($vers['v'], 2, 1) >= 1 ) {
+	if (($vers['v']{0} == 4 AND $vers['v']{2} >= 1)
+		OR $vers['v']{0} > 4) {
 		$hex_fmt = '';
 		$select_hash = 'hash AS h';
 	} else {
-- 
GitLab