Tapioka Posted May 19, 2015 Share Posted May 19, 2015 Help please White screen at the entrance to the product page In log file write^ PHP Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in /public_html/classes/Tools.php on line 1149 on line 1149 // Remove all non-whitelist chars. if ($allow_accented_chars) $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); Found a similar theme, as written it did not help. version 1.6.0.6 php 5.4 Edit, and version 5.3 does not help Link to comment Share on other sites More sharing options...
presta.show Posted May 19, 2015 Share Posted May 19, 2015 In my opinion problem is in char '-' becouse in regeax mean betwen like [0-9]. if ($allow_accented_chars) $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); try change regeax Link to comment Share on other sites More sharing options...
Tapioka Posted May 22, 2015 Author Share Posted May 22, 2015 In my opinion problem is in char '-' becouse in regeax mean betwen like [0-9]. if ($allow_accented_chars) $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); try change regeax Could you show the correct code? Link to comment Share on other sites More sharing options...
Tapioka Posted May 22, 2015 Author Share Posted May 22, 2015 Ok, understand, I added \ in my line 1149 was $str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-\pL]/u', '', $str); now $str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]\-\pL]/u', '', $str); i`ts work, Errors are gone. Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now