Make WordPress Core

Ticket #25229: http.php.diff

File http.php.diff, 1.8 KB (added by tw2113, 11 years ago)
  • wp-includes/http.php

     
    338338        if ( ! empty ( $_SERVER[ 'HTTP_ORIGIN' ] ) )
    339339                $origin = $_SERVER[ 'HTTP_ORIGIN' ];
    340340
     341        /**
     342         * Change the origin of an HTTP requestion.
     343         *
     344         * @since  3.4.0
     345         * @param string $origin The original origin for the request
     346         */
    341347        return apply_filters( 'http_origin', $origin );
    342348}
    343349
     
    360366                'https://' . $home_origin[ 'host' ],
    361367        ) );
    362368
     369        /**
     370         * Change the origin types allowed for http requests.
     371         *
     372         * @since  3.4.0
     373         * @param  array $allowed_origins Default allowed http origins.
     374         */
    363375        return apply_filters( 'allowed_http_origins' , $allowed_origins );
    364376}
    365377
     
    380392        if ( $origin && ! in_array( $origin, get_allowed_http_origins() ) )
    381393                $origin = '';
    382394
     395        /**
     396         * Change the allowed http origin result.
     397         *
     398         * @since  3.4.0
     399         * @param  string $origin Result of check for allowed origin.
     400         * @param  string $origin_arg original origin string passed into is_allowed_http_origin function.
     401         */
    383402        return apply_filters( 'allowed_http_origin', $origin, $origin_arg );
    384403}
    385404
     
    458477                                || ( 192 === $parts[0] && 168 === $parts[1] )
    459478                        ) {
    460479                                // If host appears local, reject unless specifically allowed.
     480                                /**
     481                                 * Check if http request is external or not.
     482                                 *
     483                                 * Allows to change and allow external requests for the http request'
     484                                 *
     485                                 * @since  3.6.0
     486                                 * @param  bool false Whether http request is external or not.
     487                                 * @param  string $host IP of the requested host.
     488                                 * @param  string $url URL of the requested host.
     489                                 */
    461490                                if ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) )
    462491                                        return false;
    463492                        }