From 2eaea9cb802c748ae772467b00a9f2db5679a143 Mon Sep 17 00:00:00 2001 From: rGaillard Date: Wed, 11 Jul 2012 15:09:51 +0000 Subject: [PATCH] [-] FO: Fix dispatcher which not allow underscores on rewrited urls git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16349 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/Dispatcher.php | 58 +++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/classes/Dispatcher.php b/classes/Dispatcher.php index 4c7399d27..070fc58d4 100644 --- a/classes/Dispatcher.php +++ b/classes/Dispatcher.php @@ -51,15 +51,15 @@ class DispatcherCore 'rule' => '{category:/}{id}-{rewrite}{-:ean13}.html', 'keywords' => array( 'id' => array('regexp' => '[0-9]+', 'param' => 'id_product'), - 'rewrite' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'ean13' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'category' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'categories' => array('regexp' => '[/a-zA-Z0-9-\pL]*'), - 'reference' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'meta_keywords' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'meta_title' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'manufacturer' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'supplier' => array('regexp' => '[a-zA-Z0-9-\pL]*'), + 'rewrite' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'ean13' => array('regexp' => '[0-9\pL]*'), + 'category' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'categories' => array('regexp' => '[/_a-zA-Z0-9-\pL]*'), + 'reference' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'manufacturer' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'supplier' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), 'price' => array('regexp' => '[0-9\.,]*'), 'tags' => array('regexp' => '[a-zA-Z0-9-\pL]*'), ), @@ -71,9 +71,9 @@ class DispatcherCore 'id' => array('regexp' => '[0-9]+', 'param' => 'id_category'), /* Selected filters is used by the module blocklayered */ 'selected_filters' => array('regexp' => '.*', 'param' => 'selected_filters'), - 'rewrite' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'meta_keywords' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'meta_title' => array('regexp' => '[a-zA-Z0-9-\pL]*'), + 'rewrite' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), ), ), 'category_rule' => array( @@ -81,9 +81,9 @@ class DispatcherCore 'rule' => '{id}-{rewrite}', 'keywords' => array( 'id' => array('regexp' => '[0-9]+', 'param' => 'id_category'), - 'rewrite' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'meta_keywords' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'meta_title' => array('regexp' => '[a-zA-Z0-9-\pL]*'), + 'rewrite' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), ), ), 'supplier_rule' => array( @@ -91,9 +91,9 @@ class DispatcherCore 'rule' => '{id}__{rewrite}', 'keywords' => array( 'id' => array('regexp' => '[0-9]+', 'param' => 'id_supplier'), - 'rewrite' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'meta_keywords' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'meta_title' => array('regexp' => '[a-zA-Z0-9-\pL]*'), + 'rewrite' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), ), ), 'manufacturer_rule' => array( @@ -101,9 +101,9 @@ class DispatcherCore 'rule' => '{id}_{rewrite}', 'keywords' => array( 'id' => array('regexp' => '[0-9]+', 'param' => 'id_manufacturer'), - 'rewrite' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'meta_keywords' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'meta_title' => array('regexp' => '[a-zA-Z0-9-\pL]*'), + 'rewrite' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), ), ), 'cms_rule' => array( @@ -111,9 +111,9 @@ class DispatcherCore 'rule' => 'content/{id}-{rewrite}', 'keywords' => array( 'id' => array('regexp' => '[0-9]+', 'param' => 'id_cms'), - 'rewrite' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'meta_keywords' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'meta_title' => array('regexp' => '[a-zA-Z0-9-\pL]*'), + 'rewrite' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), ), ), 'cms_category_rule' => array( @@ -121,17 +121,17 @@ class DispatcherCore 'rule' => 'content/category/{id}-{rewrite}', 'keywords' => array( 'id' => array('regexp' => '[0-9]+', 'param' => 'id_cms_category'), - 'rewrite' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'meta_keywords' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - 'meta_title' => array('regexp' => '[a-zA-Z0-9-\pL]*'), + 'rewrite' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), ), ), 'module' => array( 'controller' => null, 'rule' => 'module/{module}{/:controller}', 'keywords' => array( - 'module' => array('regexp' => '[a-zA-Z0-9_-]+', 'param' => 'module'), - 'controller' => array('regexp' => '[a-zA-Z0-9_-]+', 'param' => 'controller'), + 'module' => array('regexp' => '[_a-zA-Z0-9_-]+', 'param' => 'module'), + 'controller' => array('regexp' => '[_a-zA-Z0-9_-]+', 'param' => 'controller'), ), 'params' => array( 'fc' => 'module',