Skip to content

Commit 5c5f645

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@61706 602fd350-edb4-49c9-b593-d223f7449a82
1 parent f6927c8 commit 5c5f645

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/wp-includes/class-wp-http.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ public function request( $url, $args = array() ) {
299299
}
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 );
305306
return $response;

0 commit comments

Comments
 (0)