From 9973d89a4100ee35ce3ea2c0e1c0dc8cbdcf4797 Mon Sep 17 00:00:00 2001 From: Prashant Baldha Date: Wed, 10 Sep 2025 18:10:58 +0530 Subject: [PATCH 1/2] Filter the list of accessible hosts --- src/wp-includes/class-wp-http.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/wp-includes/class-wp-http.php b/src/wp-includes/class-wp-http.php index 2e3a9dec22639..8ac33cd537b10 100644 --- a/src/wp-includes/class-wp-http.php +++ b/src/wp-includes/class-wp-http.php @@ -927,6 +927,17 @@ public function block_request( $uri ) { if ( null === $accessible_hosts ) { $accessible_hosts = preg_split( '|,\s*|', WP_ACCESSIBLE_HOSTS ); + /** + * Filter the list of accessible hosts. + * + * @since 6.9 + * + * @param array $wp_accessible_hosts List of accessible hosts. + * @param string $uri The URL being accessed. + * @param array $check The pasesed URL being accessed. + */ + $accessible_hosts = apply_filters( 'wp_http_accessible_hosts', $wp_accessible_hosts, $uri, $check ); + if ( str_contains( WP_ACCESSIBLE_HOSTS, '*' ) ) { $wildcard_regex = array(); foreach ( $accessible_hosts as $host ) { From 066a2855f4e98c150aa6b225546681a0a21e67e3 Mon Sep 17 00:00:00 2001 From: Prashant Baldha Date: Thu, 11 Sep 2025 10:38:28 +0530 Subject: [PATCH 2/2] Update src/wp-includes/class-wp-http.php Co-authored-by: Mukesh Panchal --- src/wp-includes/class-wp-http.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/class-wp-http.php b/src/wp-includes/class-wp-http.php index 8ac33cd537b10..01a212c8b46fd 100644 --- a/src/wp-includes/class-wp-http.php +++ b/src/wp-includes/class-wp-http.php @@ -932,9 +932,9 @@ public function block_request( $uri ) { * * @since 6.9 * - * @param array $wp_accessible_hosts List of accessible hosts. - * @param string $uri The URL being accessed. - * @param array $check The pasesed URL being accessed. + * @param array $wp_accessible_hosts List of accessible hosts. + * @param string $uri The URL being accessed. + * @param array $check The pasesed URL being accessed. */ $accessible_hosts = apply_filters( 'wp_http_accessible_hosts', $wp_accessible_hosts, $uri, $check );