Use strpos() instead of preg_match() when searching for $req_uri at the head of the rewrite rule $match. This avoids regex compilation errors when $req_uri contains characters will special regex meaning. strpos() is also faster than preg_match().
git-svn-id: https://develop.svn.wordpress.org/trunk@975 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
62e8849bc6
commit
4e5eb1bb45
@ -33,7 +33,7 @@ if (! empty($_SERVER['PATH_INFO'])) {
|
||||
foreach ($rewrite as $match => $query) {
|
||||
// If the request URI is the anchor of the match, prepend it
|
||||
// to the path info.
|
||||
if (preg_match("!^$req_uri!", $match)) {
|
||||
if (strpos($match, $req_uri) === 0) {
|
||||
$pathinfomatch = $req_uri . '/' . $pathinfo;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user