Reputation: 532
Suddenly my friend's WordPress based website started showing up this warning on subpages:
Warning: preg_match(): Compilation failed: nothing to repeat at offset 1 in /wp-includes/class-wp.php on line 218
Lines 218/219 that are returned in the warning are as follows:
if ( preg_match("#^$match#", $request_match, $matches) ||
preg_match("#^$match#", urldecode($request_match), $matches) ) {
Seems like the code is responsible for URL reworking.
Any ideas what could possibly be going wrong?
Upvotes: 2
Views: 6750
Reputation: 159
I had this very same issue and it was driving me crazy!
It was a simple fix for me, hopefully will be for anyone else who has the same issue!
All I had to do was login to the backend of the site with /wp-admin and then go to Settings > Permalinks and then set it to 'Post Name' and then click 'Save Changes'. Hard refresh the page/s you had the issue on and it might just be resolved.
Upvotes: 0
Reputation: 18980
The error does not appear on the homepage but on sub-pages. Thus, I guess the permalinks structure is corrupt. An often suggested fix goes like this:
preg_match
errors gone?Upvotes: 5