Use parse_url instead of regex wackiness.
git-svn-id: http://svn.automattic.com/wordpress/trunk@2187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d883df1424
commit
bacd080989
|
@ -1154,13 +1154,11 @@ class WP_Rewrite {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$site_root = str_replace('http://', '', trim(get_settings('siteurl')));
|
$site_root = parse_url(get_settings('siteurl'));
|
||||||
$site_root = preg_replace('|([^/]*)(.*)|i', '$2', $site_root);
|
$site_root = trailingslashit($site_root['path']);
|
||||||
if ('/' != substr($site_root, -1)) $site_root = $site_root . '/';
|
|
||||||
|
|
||||||
$home_root = str_replace('http://', '', trim(get_settings('home')));
|
$home_root = parse_url(get_settings('home'));
|
||||||
$home_root = preg_replace('|([^/]*)(.*)|i', '$2', $home_root);
|
$home_root = trailingslashit($home_root['path']);
|
||||||
if ('/' != substr($home_root, -1)) $home_root = $home_root . '/';
|
|
||||||
|
|
||||||
$rules = "<IfModule mod_rewrite.c>\n";
|
$rules = "<IfModule mod_rewrite.c>\n";
|
||||||
$rules .= "RewriteEngine On\n";
|
$rules .= "RewriteEngine On\n";
|
||||||
|
|
Loading…
Reference in New Issue