2021-07-25 23:24:56 +00:00
|
|
|
<?php
|
|
|
|
namespace Activitypub;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Allow localhost URLs if WP_DEBUG is true.
|
|
|
|
*
|
|
|
|
* @param array $r Array of HTTP request args.
|
|
|
|
* @param string $url The request URL.
|
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
|
|
|
*/
|
|
|
|
function allow_localhost( $r, $url ) {
|
|
|
|
$r['reject_unsafe_urls'] = false;
|
|
|
|
|
|
|
|
return $r;
|
|
|
|
}
|
|
|
|
add_filter( 'http_request_args', '\Activitypub\allow_localhost', 10, 2 );
|