mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
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 '';
|
||||
}
|
||||
|
||||
$site_root = str_replace('http://', '', trim(get_settings('siteurl')));
|
||||
$site_root = preg_replace('|([^/]*)(.*)|i', '$2', $site_root);
|
||||
if ('/' != substr($site_root, -1)) $site_root = $site_root . '/';
|
||||
$site_root = parse_url(get_settings('siteurl'));
|
||||
$site_root = trailingslashit($site_root['path']);
|
||||
|
||||
$home_root = str_replace('http://', '', trim(get_settings('home')));
|
||||
$home_root = preg_replace('|([^/]*)(.*)|i', '$2', $home_root);
|
||||
if ('/' != substr($home_root, -1)) $home_root = $home_root . '/';
|
||||
$home_root = parse_url(get_settings('home'));
|
||||
$home_root = trailingslashit($home_root['path']);
|
||||
|
||||
$rules = "<IfModule mod_rewrite.c>\n";
|
||||
$rules .= "RewriteEngine On\n";
|
||||
|
Loading…
Reference in New Issue
Block a user