wordpress-activitypub/includes/debug.php

18 lines
417 B
PHP
Raw Normal View History

2021-07-23 13:46:28 +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-05-10 13:36:45 +00:00
*
* @return array Array or string of HTTP request arguments.
2021-07-23 13:46:28 +00:00
*/
2024-07-26 08:26:47 +00:00
function allow_localhost( $r, $url ) { // phpcs:ignore
2021-07-23 13:46:28 +00:00
$r['reject_unsafe_urls'] = false;
return $r;
}
add_filter( 'http_request_args', '\Activitypub\allow_localhost', 10, 2 );