From 99ea3245af7525b5a0ade474179798014cfcb12c Mon Sep 17 00:00:00 2001 From: saxmatt Date: Mon, 24 Jan 2005 07:30:49 +0000 Subject: [PATCH] Siteurl autoupdate now requires RELOCATE flag - http://mosquito.wordpress.org/view.php?id=602 git-svn-id: http://svn.automattic.com/wordpress/trunk@2130 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 8 ++++---- wp-login.php | 13 +++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index ef6d9cc79..cc001b251 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1629,15 +1629,15 @@ function add_magic_quotes($array) { } function wp_setcookie($username, $password, $already_md5 = false, $home = '', $siteurl = '') { - if ( ! $already_md5) - $password = md5(md5($password)); // Double hash the password in the cookie. + if ( !$already_md5 ) + $password = md5( md5($password) ); // Double hash the password in the cookie. - if (empty($home)) + if ( empty($home) ) $cookiepath = COOKIEPATH; else $cookiepath = preg_replace('|https?://[^/]+|i', '', $home . '/' ); - if (empty($siteurl)) { + if ( empty($siteurl) ) { $sitecookiepath = SITECOOKIEPATH; $cookiehash = COOKIEHASH; } else { diff --git a/wp-login.php b/wp-login.php index d9c190e19..a521089b0 100644 --- a/wp-login.php +++ b/wp-login.php @@ -9,12 +9,13 @@ header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-cache, must-revalidate'); header('Pragma: no-cache'); -// If someone has moved WordPress let's try to detect it -if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) ) - $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] ); - -if ( dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_settings('siteurl') ) - update_option('siteurl', dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) ); +if ( defined('RELOCATE') ) { // Move flag is set + if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) ) + $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] ); + + if ( dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_settings('siteurl') ) + update_option('siteurl', dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) ); +} switch($action) {