[*] BO : the option for accented URLs is now available in the backend
This commit is contained in:
+4
-4
@@ -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.'),
|
||||
|
||||
Reference in New Issue
Block a user