From 1f1ffbcdd227bfe66659e33b6311e63efffbe4bc Mon Sep 17 00:00:00 2001 From: Rodney Figaro Date: Thu, 9 Feb 2017 12:30:10 +0100 Subject: [PATCH] Fix bug core prestashop on accentued characters in str2url --- classes/Tools.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/classes/Tools.php b/classes/Tools.php index 622e6f5..60b89db 100755 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -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);