mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-28 07:07:38 +02:00
Anchor str replacements to head so that we don't replace across the entire string. fixes #2162
git-svn-id: http://svn.automattic.com/wordpress/trunk@3370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b64e33619d
commit
8906eb2557
@ -1461,16 +1461,21 @@ class WP {
|
|||||||
$self = $_SERVER['PHP_SELF'];
|
$self = $_SERVER['PHP_SELF'];
|
||||||
$home_path = parse_url(get_settings('home'));
|
$home_path = parse_url(get_settings('home'));
|
||||||
$home_path = $home_path['path'];
|
$home_path = $home_path['path'];
|
||||||
|
$home_path = trim($home_path, '/');
|
||||||
|
|
||||||
// Trim path info from the end and the leading home path from the
|
// Trim path info from the end and the leading home path from the
|
||||||
// front. For path info requests, this leaves us with the requesting
|
// front. For path info requests, this leaves us with the requesting
|
||||||
// filename, if any. For 404 requests, this leaves us with the
|
// filename, if any. For 404 requests, this leaves us with the
|
||||||
// requested permalink.
|
// requested permalink.
|
||||||
$req_uri = str_replace($pathinfo, '', $req_uri);
|
$req_uri = str_replace($pathinfo, '', $req_uri);
|
||||||
$req_uri = str_replace($home_path, '', $req_uri);
|
|
||||||
$req_uri = trim($req_uri, '/');
|
$req_uri = trim($req_uri, '/');
|
||||||
$pathinfo = str_replace($home_path, '', $pathinfo);
|
$req_uri = preg_replace("|^$home_path|", '', $req_uri);
|
||||||
|
$req_uri = trim($req_uri, '/');
|
||||||
$pathinfo = trim($pathinfo, '/');
|
$pathinfo = trim($pathinfo, '/');
|
||||||
|
$pathinfo = preg_replace("|^$home_path|", '', $pathinfo);
|
||||||
|
$pathinfo = trim($pathinfo, '/');
|
||||||
|
$self = trim($self, '/');
|
||||||
|
$self = preg_replace("|^$home_path|", '', $self);
|
||||||
$self = str_replace($home_path, '', $self);
|
$self = str_replace($home_path, '', $self);
|
||||||
$self = trim($self, '/');
|
$self = trim($self, '/');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user