Changeset 27484
- Timestamp:
- 03/09/2014 03:22:13 PM (9 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/default-filters.php
r27154 r27484 301 301 add_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 ); 302 302 add_filter( 'authenticate', 'wp_authenticate_spam_check', 99 ); 303 add_filter( 'determine_current_user', 'wp_validate_auth_cookie' ); 304 add_filter( 'determine_current_user', 'wp_validate_logged_in_cookie', 20 ); 303 305 304 306 unset($filter, $action); -
trunk/src/wp-includes/pluggable.php
r27149 r27484 98 98 } 99 99 100 if ( ! $user = wp_validate_auth_cookie() ) { 101 if ( is_blog_admin() || is_network_admin() || empty( $_COOKIE[LOGGED_IN_COOKIE] ) || !$user = wp_validate_auth_cookie( $_COOKIE[LOGGED_IN_COOKIE], 'logged_in' ) ) { 102 wp_set_current_user( 0 ); 103 return false; 104 } 105 } 106 107 wp_set_current_user( $user ); 100 /** 101 * Determine the current user based on request data. 102 * 103 * The default filters use this to determine the current user from the 104 * request's cookies, if available. 105 * 106 * @since 3.9.0 107 * 108 * @param int|boolean $user_id User ID if determined, or false otherwise. 109 */ 110 $user_id = apply_filters( 'determine_current_user', false ); 111 if ( ! $user_id ) { 112 wp_set_current_user( 0 ); 113 return false; 114 } 115 116 wp_set_current_user( $user_id ); 108 117 } 109 118 endif; -
trunk/src/wp-includes/user.php
r27354 r27484 218 218 } 219 219 return $user; 220 } 221 222 /** 223 * Validates logged in cookie. 224 * 225 * Checks the logged_in cookie if the previous auth cookie could not be 226 * validated and parsed. 227 * 228 * This is a callback for the determine_current_user filter, rather than API. 229 * 230 * @since 3.9.0 231 * 232 * @param int|boolean $user The user ID (or false) as received from the determine_current_user filter. 233 * @return int|boolean User ID if validated, or false otherwise. If it receives a user ID from 234 * an earlier filter callback, that value is returned. 235 */ 236 function wp_validate_logged_in_cookie( $user_id ) { 237 if ( $user_id ) { 238 return $user_id; 239 } 240 241 if ( is_blog_admin() || is_network_admin() || empty( $_COOKIE[LOGGED_IN_COOKIE] ) ) { 242 return false; 243 } 244 245 return wp_validate_auth_cookie( $_COOKIE[LOGGED_IN_COOKIE], 'logged_in' ); 220 246 } 221 247
Note: See TracChangeset
for help on using the changeset viewer.