Jump to content

White screen at the entrance to the product page


Tapioka

Recommended Posts

 
Help please :unsure:
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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...