Airo Dump Airo Dump - 2 months ago 25
PHP Question

wordpress get error with Warning: preg_match()

I'm getting this error with my Wordpress at localhost. It works ok but after I upload I get an error like this :


Warning: preg_match(): Compilation failed: unmatched parentheses at
offset 24 in /home/***/public_html/wp-includes/class-wp.php on line
231

Warning: preg_match(): Compilation failed: unmatched parentheses at
offset 24 in /home/***/public_html/wp-includes/class-wp.php on line
232

Warning: Cannot modify header information - headers already sent by
(output started at
/home/tokowena/public_html/wp-includes/class-wp.php:231) in
/home/***/public_html/wp-includes/pluggable.php on line 1174


at line 213 and 232 i see this :

if ( preg_match("#^$match#", $request_match, $matches) ||
preg_match("#^$match#", urldecode($request_match), $matches) ) {


How can I solve it?

Answer

Try this

 if ( preg_match("#^".preg_quote($match,'#'),"#", $request_match, $matches) ||

Note also remove the extra ) before ||