Skip to content

Commit

Permalink
REST API: Revert [45687].
Browse files Browse the repository at this point in the history
This change may not be needed and further investigation is required before we accept it into a release.

See #46907.



git-svn-id: https://develop.svn.wordpress.org/trunk@46191 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
kadamwhite committed Sep 19, 2019
1 parent 09e56c0 commit 0734694
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/wp-includes/rest-api/class-wp-rest-server.php
Expand Up @@ -103,13 +103,11 @@ public function __construct() {
* Checks the authentication headers if supplied.
*
* @since 4.4.0
* @since 5.3.0 Added the `$request` parameter.
*
* @param WP_REST_Request $request Full data about the request.
* @return WP_Error|null WP_Error indicates unsuccessful login, null indicates successful
* or no authentication provided
*/
public function check_authentication( $request ) {
public function check_authentication() {
/**
* Filters REST authentication errors.
*
Expand All @@ -130,13 +128,11 @@ public function check_authentication( $request ) {
* the authentication method was used, and it succeeded.
*
* @since 4.4.0
* @since 5.3.0 Added the `$request` argument.
*
* @param WP_Error|null|bool $result WP_Error if authentication error, null if authentication
* method wasn't used, true if authentication succeeded.
* @param WP_REST_Request $request Full data about the request.
* @param WP_Error|null|bool WP_Error if authentication error, null if authentication
* method wasn't used, true if authentication succeeded.
*/
return apply_filters( 'rest_authentication_errors', null, $request );
return apply_filters( 'rest_authentication_errors', null );
}

/**
Expand Down Expand Up @@ -327,7 +323,7 @@ public function serve_request( $path = null ) {
$request->set_method( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] );
}

$result = $this->check_authentication( $request );
$result = $this->check_authentication();

if ( ! is_wp_error( $result ) ) {
$result = $this->dispatch( $request );
Expand Down

0 comments on commit 0734694

Please sign in to comment.