| @@ -1,17 +1,22 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * Debugging functions. | |
| 4 | + * | |
| 5 | + * @package Activitypub | |
| 6 | + */ | |
| 7 | + | |
| 2 | 8 | namespace Activitypub; |
| 3 | 9 | |
| 4 | 10 | /** |
| 5 | 11 | * Allow localhost URLs if WP_DEBUG is true. |
| 6 | 12 | * |
| 7 | - * @param array $r Array of HTTP request args. | |
| 8 | - * @param string $url The request URL. | |
| 13 | + * @param array $parsed_args An array of HTTP request arguments. | |
| 9 | 14 | * |
| 10 | 15 | * @return array Array or string of HTTP request arguments. |
| 11 | 16 | */ |
| 12 | -function allow_localhost( $r, $url ) { | |
| 13 | - $r['reject_unsafe_urls'] = false; | |
| 17 | +function allow_localhost( $parsed_args ) { | |
| 18 | + $parsed_args['reject_unsafe_urls'] = false; | |
| 14 | 19 | |
| 15 | - return $r; | |
| 20 | + return $parsed_args; | |
| 16 | 21 | } |
| 17 | -add_filter( 'http_request_args', '\Activitypub\allow_localhost', 10, 2 ); | |
| 22 | +add_filter( 'http_request_args', '\Activitypub\allow_localhost' ); | |