[*] BO : the option for accented URLs is now available in the backend

This commit is contained in:
Damien Metzger
2013-02-14 09:15:01 +01:00
parent 876b4c09bc
commit 849c2da9eb
2 changed files with 11 additions and 4 deletions
+4 -4
View File
@@ -978,11 +978,11 @@ class ToolsCore
if ($allow_accented_chars === null)
$allow_accented_chars = Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL');
$str = trim($str);
if (function_exists('mb_strtolower'))
$str = mb_strtolower($str, 'utf-8');
$str = trim($str);
if (!function_exists('mb_strtolower') || !$allow_accented_chars)
elseif (!$allow_accented_chars)
$str = Tools::replaceAccentedChars($str);
// Remove all non-whitelist chars.
@@ -990,7 +990,7 @@ class ToolsCore
$str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-\pL]/u', '', $str);
else
$str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-]/','', $str);
$str = preg_replace('/[\s\'\:\/\[\]-]+/', ' ', $str);
$str = str_replace(array(' ', '/'), '-', $str);
@@ -64,6 +64,13 @@ class AdminMetaControllerCore extends AdminController
'type' => 'rewriting_settings',
'mod_rewrite' => $mod_rewrite
),
'PS_ALLOW_ACCENTED_CHARS_URL' => array(
'title' => $this->l('Accented URL'),
'desc' => $this->l('Enable if you want to allow accented characters in your friendly URLs.'),
'validation' => 'isBool',
'cast' => 'intval',
'type' => 'bool'
),
'PS_CANONICAL_REDIRECT' => array(
'title' => $this->l('Automatically redirect to the canonical URL.'),
'desc' => $this->l('Recommended, but your theme must be compliant.'),