Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Let advanced users override cookies.

git-svn-id: http://svn.automattic.com/wordpress/trunk@2725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
commit 41afea2f945e49c38f1ba2acbc67472a8a8d3708 1 parent 5ac98a6
matt authored
View
16 wp-includes/pluggable-functions.php
@@ -191,22 +191,22 @@ function wp_setcookie($username, $password, $already_md5 = false, $home = '', $s
$cookiehash = md5($siteurl);
}
- setcookie('wordpressuser_'. $cookiehash, $username, time() + 31536000, $cookiepath);
- setcookie('wordpresspass_'. $cookiehash, $password, time() + 31536000, $cookiepath);
+ setcookie(USER_COOKIE, $username, time() + 31536000, $cookiepath, COOKIE_DOMAIN);
+ setcookie(PASS_COOKIE, $password, time() + 31536000, $cookiepath, COOKIE_DOMAIN);
if ( $cookiepath != $sitecookiepath ) {
- setcookie('wordpressuser_'. $cookiehash, $username, time() + 31536000, $sitecookiepath);
- setcookie('wordpresspass_'. $cookiehash, $password, time() + 31536000, $sitecookiepath);
+ setcookie(USER_COOKIE, $username, time() + 31536000, $sitecookiepath, COOKIE_DOMAIN);
+ setcookie(PASS_COOKIE, $password, time() + 31536000, $sitecookiepath, COOKIE_DOMAIN);
}
}
endif;
if ( !function_exists('wp_clearcookie') ) :
function wp_clearcookie() {
- setcookie('wordpressuser_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
- setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
- setcookie('wordpressuser_' . COOKIEHASH, ' ', time() - 31536000, SITECOOKIEPATH);
- setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, SITECOOKIEPATH);
+ setcookie(USER_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);
+ setcookie(PASS_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);
+ setcookie(USER_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);
+ setcookie(PASS_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);
}
endif;
View
4 wp-includes/vars.php
@@ -106,8 +106,4 @@ function smiliescmp ($a, $b) {
$wp_smiliesreplace[] = " <img src='" . get_settings('siteurl') . "/wp-images/smilies/$img' alt='$smiley_masked' class='wp-smiley' /> ";
}
-// Path for cookies
-define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('home') . '/' ) );
-define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('siteurl') . '/' ) );
-
?>
View
13 wp-settings.php
@@ -56,7 +56,7 @@ function timer_start() {
$wpdb->users = CUSTOM_USER_TABLE;
if ( defined('CUSTOM_USER_META_TABLE') )
$wpdb->usermeta = CUSTOM_USER_META_TABLE;
-
+
// We're going to need to keep this around for a few months even though we're not using it internally
$tableposts = $wpdb->posts;
@@ -104,6 +104,17 @@ function timer_start() {
define('COOKIEHASH', $cookiehash);
endif;
+if ( !defined('USER_COOKIE') )
+ define('USER_COOKIE', 'wordpressuser_'. COOKIEHASH);
+if ( !defined('PASS_COOKIE') )
+ define('PASS_COOKIE', 'wordpresspass_'. COOKIEHASH);
+if ( !defined('COOKIEPATH') )
+ define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('home') . '/' ) );
+if ( !defined('SITECOOKIEPATH') )
+ define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('siteurl') . '/' ) );
+if ( !defined('COOKIE_DOMAIN') )
+ define('COOKIE_DOMAIN', false);
+
require (ABSPATH . WPINC . '/vars.php');
do_action('core_files_loaded');
Please sign in to comment.
Something went wrong with that request. Please try again.