Make WordPress Core

Changeset 39027


Ignore:
Timestamp:
10/30/2016 05:41:15 PM (8 years ago)
Author:
DrewAPicture
Message:

REST: Fix a yoda condition in WP_REST_Request::get_parameter_order() and add a missing period for an inline comment in `WP_REST_Request::from_url().

Props mrahmadawais.
See #38398.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/class-wp-rest-request.php

    r38601 r39027  
    360360        // Ensure we parse the body data.
    361361        $body = $this->get_body();
    362         if ( $this->method !== 'POST' && ! empty( $body ) ) {
     362
     363        if ( 'POST' !== $this->method && ! empty( $body ) ) {
    363364            $this->parse_body_params();
    364365        }
     
    968969        $api_root = rest_url();
    969970        if ( get_option( 'permalink_structure' ) && 0 === strpos( $url, $api_root ) ) {
    970             // Pretty permalinks on, and URL is under the API root
     971            // Pretty permalinks on, and URL is under the API root.
    971972            $api_url_part = substr( $url, strlen( untrailingslashit( $api_root ) ) );
    972973            $route = parse_url( $api_url_part, PHP_URL_PATH );
Note: See TracChangeset for help on using the changeset viewer.