From 7879bdd33ce7f76fb5bbc6070a048ee16ed35d77 Mon Sep 17 00:00:00 2001 From: Fil <fil@rezo.net> Date: Mon, 31 Jan 2005 13:46:36 +0000 Subject: [PATCH] petit bug urls propres --- inc-urls-propres.php3 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/inc-urls-propres.php3 b/inc-urls-propres.php3 index 5061aa510d..4080f8f1e8 100644 --- a/inc-urls-propres.php3 +++ b/inc-urls-propres.php3 @@ -118,13 +118,14 @@ function recuperer_parametres_url($fond, $url) { // Migration depuis anciennes URLs ? if ($GLOBALS['_SERVER']['REQUEST_METHOD'] != 'POST' && - preg_match(',(^|/)(article|breve|rubrique|mot)\.php3?([\?&].*)?$,', $url, $regs)) { - $type = $regs[2]; + preg_match(',(^|/)((article|breve|rubrique|mot)\.php3?([\?&].*)?)$,', $url, $regs)) { + $type = $regs[3]; $id_objet = intval($GLOBALS['id_'.$type]); if ($id_objet) { $func = "generer_url_$type"; $url_propre = $func($id_objet); - if ($url_propre) { + if ($url_propre + AND ($url_propre<>$regs[2])) { http_status(301); Header("Location: $url_propre"); exit; -- GitLab