From 4e5eb1bb4530396d0bbb3aed7a3ab862e6e41c68 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sun, 14 Mar 2004 13:33:03 +0000 Subject: [PATCH] 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 --- wp-blog-header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-blog-header.php b/wp-blog-header.php index cc4aec4e7c..8ca6d65c62 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -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; }