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

This commit is contained in:
Damien Metzger committed 2013-02-14 09:15:01 +01:00
1 parent c7e87eb195
commit 2890e439b5
2 files changed
+11 -4

No files matched your search

+4 -4
View File
@@ -978,11 +978,11 @@ class ToolsCore
if ($allow_accented_chars === null) if ($allow_accented_chars === null)
$allow_accented_chars = Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL'); $allow_accented_chars = Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL');
$str = trim($str);
if (function_exists('mb_strtolower')) if (function_exists('mb_strtolower'))
$str = mb_strtolower($str, 'utf-8'); $str = mb_strtolower($str, 'utf-8');
elseif (!$allow_accented_chars)
$str = trim($str);
if (!function_exists('mb_strtolower') || !$allow_accented_chars)
$str = Tools::replaceAccentedChars($str); $str = Tools::replaceAccentedChars($str);
// Remove all non-whitelist chars. // Remove all non-whitelist chars.
@@ -990,7 +990,7 @@ class ToolsCore
$str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-\pL]/u', '', $str); $str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-\pL]/u', '', $str);
else else
$str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-]/','', $str); $str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-]/','', $str);
$str = preg_replace('/[\s\'\:\/\[\]-]+/', ' ', $str); $str = preg_replace('/[\s\'\:\/\[\]-]+/', ' ', $str);
$str = str_replace(array(' ', '/'), '-', $str); $str = str_replace(array(' ', '/'), '-', $str);
@@ -64,6 +64,13 @@ class AdminMetaControllerCore extends AdminController
'type' => 'rewriting_settings', 'type' => 'rewriting_settings',
'mod_rewrite' => $mod_rewrite '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( 'PS_CANONICAL_REDIRECT' => array(
'title' => $this->l('Automatically redirect to the canonical URL.'), 'title' => $this->l('Automatically redirect to the canonical URL.'),
'desc' => $this->l('Recommended, but your theme must be compliant.'), 'desc' => $this->l('Recommended, but your theme must be compliant.'),