Ticket #25229: http.php.diff
File http.php.diff, 1.8 KB (added by , 11 years ago) |
---|
-
wp-includes/http.php
338 338 if ( ! empty ( $_SERVER[ 'HTTP_ORIGIN' ] ) ) 339 339 $origin = $_SERVER[ 'HTTP_ORIGIN' ]; 340 340 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 */ 341 347 return apply_filters( 'http_origin', $origin ); 342 348 } 343 349 … … 360 366 'https://' . $home_origin[ 'host' ], 361 367 ) ); 362 368 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 */ 363 375 return apply_filters( 'allowed_http_origins' , $allowed_origins ); 364 376 } 365 377 … … 380 392 if ( $origin && ! in_array( $origin, get_allowed_http_origins() ) ) 381 393 $origin = ''; 382 394 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 */ 383 402 return apply_filters( 'allowed_http_origin', $origin, $origin_arg ); 384 403 } 385 404 … … 458 477 || ( 192 === $parts[0] && 168 === $parts[1] ) 459 478 ) { 460 479 // 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 */ 461 490 if ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) ) 462 491 return false; 463 492 }