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: http://svn.automattic.com/wordpress/trunk@975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rboren 2004-03-14 13:33:03 +00:00
parent 44f59de914
commit 5670d0e1ad

View File

@ -33,7 +33,7 @@ if (! empty($_SERVER['PATH_INFO'])) {
foreach ($rewrite as $match => $query) { foreach ($rewrite as $match => $query) {
// If the request URI is the anchor of the match, prepend it // If the request URI is the anchor of the match, prepend it
// to the path info. // to the path info.
if (preg_match("!^$req_uri!", $match)) { if (strpos($match, $req_uri) === 0) {
$pathinfomatch = $req_uri . '/' . $pathinfo; $pathinfomatch = $req_uri . '/' . $pathinfo;
} }