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:
rboren 2005-02-01 07:05:00 +00:00
parent d883df1424
commit bacd080989

View File

@ -1154,14 +1154,12 @@ 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 . '/';
$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 . '/';
$site_root = parse_url(get_settings('siteurl'));
$site_root = trailingslashit($site_root['path']);
$home_root = parse_url(get_settings('home'));
$home_root = trailingslashit($home_root['path']);
$rules = "<IfModule mod_rewrite.c>\n";
$rules .= "RewriteEngine On\n";
$rules .= "RewriteBase $home_root\n";