Smilie fix from Jaykul, changed fool's siteurl fix to use faster preg_replace. Now handles *any number* of trailing slashes. :)

git-svn-id: https://develop.svn.wordpress.org/trunk@612 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2003-12-15 08:02:19 +00:00
parent db09e4cd77
commit b153d9607c

View File

@ -6,7 +6,6 @@ require ($abspath . 'wp-config-extra.php');
require ($abspath . $b2inc . '/wp-db.php'); require ($abspath . $b2inc . '/wp-db.php');
require ($abspath . $b2inc . '/functions.php'); require ($abspath . $b2inc . '/functions.php');
require ($abspath . $b2inc . '/template-functions.php'); require ($abspath . $b2inc . '/template-functions.php');
require ($abspath . $b2inc . '/vars.php');
require ($abspath . $b2inc . '/class-xmlrpc.php'); require ($abspath . $b2inc . '/class-xmlrpc.php');
require ($abspath . $b2inc . '/class-xmlrpcs.php'); require ($abspath . $b2inc . '/class-xmlrpcs.php');
require ($abspath . '/wp-links/links.php'); require ($abspath . '/wp-links/links.php');
@ -40,12 +39,8 @@ if (!isset($_wp_installing) || !$_wp_installing) {
$siteurl = get_settings('siteurl'); $siteurl = get_settings('siteurl');
// "When trying to design a foolproof system, // "When trying to design a foolproof system,
// never underestimate the ingenuity of the fools :)" // never underestimate the ingenuity of the fools :)"
//
// Strip trailing slashes from $siteurl. But don't do $siteurl = preg_replace('|/+$|', '', $siteurl);
// anything that could cause an infinite loop.
while (('/' == substr($siteurl, -1)) && (10 > $i++)) {
$siteurl = substr($siteurl, 0, -1);
}
$blogfilename = get_settings('blogfilename'); $blogfilename = get_settings('blogfilename');
$blogname = get_settings('blogname'); $blogname = get_settings('blogname');
$blogdescription = get_settings('blogdescription'); $blogdescription = get_settings('blogdescription');
@ -102,4 +97,6 @@ if (!isset($_wp_installing) || !$_wp_installing) {
$cookiehash = md5($siteurl); $cookiehash = md5($siteurl);
} //end !$_wp_installing } //end !$_wp_installing
require ($abspath . $b2inc . '/vars.php');
?> ?>