2021-07-25 23:24:56 +00:00
|
|
|
<?php
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Debugging functions.
|
|
|
|
*
|
|
|
|
* @package Activitypub
|
|
|
|
*/
|
|
|
|
|
2021-07-25 23:24:56 +00:00
|
|
|
namespace Activitypub;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Allow localhost URLs if WP_DEBUG is true.
|
|
|
|
*
|
2024-10-09 12:44:17 +00:00
|
|
|
* @param array $parsed_args An array of HTTP request arguments.
|
2023-10-22 22:20:53 +00:00
|
|
|
*
|
|
|
|
* @return array Array or string of HTTP request arguments.
|
2021-07-25 23:24:56 +00:00
|
|
|
*/
|
2024-10-09 12:44:17 +00:00
|
|
|
function allow_localhost( $parsed_args ) {
|
|
|
|
$parsed_args['reject_unsafe_urls'] = false;
|
2021-07-25 23:24:56 +00:00
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
return $parsed_args;
|
2021-07-25 23:24:56 +00:00
|
|
|
}
|
2024-10-09 12:44:17 +00:00
|
|
|
add_filter( 'http_request_args', '\Activitypub\allow_localhost' );
|