Fix bug core prestashop on accentued characters in str2url

This commit is contained in:
Rodney Figaro 2017-02-09 12:30:10 +01:00
parent 12a708f713
commit 1f1ffbcdd2

View File

@ -986,10 +986,15 @@ class ToolsCore
$str = Tools::replaceAccentedChars($str);
// Remove all non-whitelist chars.
if ($allow_accented_chars)
$str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-\pL]/u', '', $str);
else
if ($allow_accented_chars) {
// @antadis fix by antadis
$str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]\pL-]/u', '', $str);
// @antadis prestashop original version
//$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);