Make WordPress Core

Changeset 61706

Timestamp:
02/20/2026 12:52:03 PM (13 days ago)
Author:
audrasjb
Message:

HTTP API: Improve error message to include the blocked URL.

This changeset adds the URL of the blocked HTTP request in http_request_not_executed.

Props wiuempe, pento, maltfield, sainathpoojary, pmbaldha, mukesh27, johnbillion.
Fixes #45164.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-http.php

    r61566 r61706  
    300300
    301301        if ( $this->block_request( $url ) ) {
    302             $response = new WP_Error( 'http_request_not_executed', __( 'User has blocked requests through HTTP.' ) );
     302            /* translators: %s: URL to which the HTTP request was blocked. */
     303            $response = new WP_Error( 'http_request_not_executed', sprintf( __( 'User has blocked requests through HTTP to the URL: %s.' ), $url ) );
    303304            /** This action is documented in wp-includes/class-wp-http.php */
    304305            do_action( 'http_api_debug', $response, 'response', 'WpOrg\Requests\Requests', $parsed_args, $url );
Note: See TracChangeset for help on using the changeset viewer.