Ticket #25229: http.php.1.diff
File http.php.1.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 * 346 * @param string $origin The original origin for the request. 347 */ 341 348 return apply_filters( 'http_origin', $origin ); 342 349 } 343 350 … … 360 367 'https://' . $home_origin[ 'host' ], 361 368 ) ); 362 369 370 /** 371 * Change the origin types allowed for http requests. 372 * 373 * @since 3.4.0 374 * 375 * @param array $allowed_origins Default allowed http origins. 376 */ 363 377 return apply_filters( 'allowed_http_origins' , $allowed_origins ); 364 378 } 365 379 … … 380 394 if ( $origin && ! in_array( $origin, get_allowed_http_origins() ) ) 381 395 $origin = ''; 382 396 397 /** 398 * Change the allowed http origin result. 399 * 400 * @since 3.4.0 401 * 402 * @param string $origin Result of check for allowed origin. 403 * @param string $origin_arg original origin string passed into is_allowed_http_origin function. 404 */ 383 405 return apply_filters( 'allowed_http_origin', $origin, $origin_arg ); 384 406 } 385 407 … … 458 480 || ( 192 === $parts[0] && 168 === $parts[1] ) 459 481 ) { 460 482 // If host appears local, reject unless specifically allowed. 483 /** 484 * Check if http request is external or not. 485 * 486 * Allows to change and allow external requests for the http request. 487 * 488 * @since 3.6.0 489 * 490 * @param bool false Whether http request is external or not. 491 * @param string $host IP of the requested host. 492 * @param string $url URL of the requested host. 493 */ 461 494 if ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) ) 462 495 return false; 463 496 }