Changeset 49109 for trunk/src/wp-includes/rest-api/class-wp-rest-server.php
- Timestamp:
- 10/08/2020 10:12:02 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/class-wp-rest-server.php
r49075 r49109 224 224 * @see WP_REST_Server::dispatch() 225 225 * 226 * @global WP_User $current_user The currently authenticated user. 227 * 226 228 * @param string $path Optional. The request route. If not set, `$_SERVER['PATH_INFO']` will be used. 227 229 * Default null. … … 229 231 */ 230 232 public function serve_request( $path = null ) { 233 /* @var WP_User|null $current_user */ 234 global $current_user; 235 236 if ( $current_user instanceof WP_User && ! $current_user->exists() ) { 237 /* 238 * If there is no current user authenticated via other means, clear 239 * the cached lack of user, so that an authenticate check can set it 240 * properly. 241 * 242 * This is done because for authentications such as Application 243 * Passwords, we don't want it to be accepted unless the current HTTP 244 * request is an API request, which can't always be identified early 245 * enough in evaluation. 246 */ 247 $current_user = null; 248 } 249 231 250 $content_type = isset( $_GET['_jsonp'] ) ? 'application/javascript' : 'application/json'; 232 251 $this->send_header( 'Content-Type', $content_type . '; charset=' . get_option( 'blog_charset' ) );
Note: See TracChangeset
for help on using the changeset viewer.