diff --git a/src/wp-includes/class-http.php b/src/wp-includes/class-http.php
index 2a458eb705..421a5f9fc5 100644
a
|
b
|
class WP_Http { |
272 | 272 | $arrURL = @parse_url( $url ); |
273 | 273 | |
274 | 274 | if ( empty( $url ) || empty( $arrURL['scheme'] ) ) { |
275 | | return new WP_Error( 'http_request_failed', __( 'A valid URL was not provided.' ) ); |
| 275 | $response = new WP_Error( 'http_request_failed', __( 'A valid URL was not provided.' ) ); |
| 276 | /** This action is documented in wp-includes/class-http.php */ |
| 277 | do_action( 'http_api_debug', $response, 'response', 'Requests', $r, $url ); |
| 278 | return $response; |
276 | 279 | } |
277 | 280 | |
278 | 281 | if ( $this->block_request( $url ) ) { |
279 | | return new WP_Error( 'http_request_failed', __( 'User has blocked requests through HTTP.' ) ); |
| 282 | $response = new WP_Error( 'http_request_blocked', __( 'User has blocked requests through HTTP.' ) ); |
| 283 | /** This action is documented in wp-includes/class-http.php */ |
| 284 | do_action( 'http_api_debug', $response, 'response', 'Requests', $r, $url ); |
| 285 | return $response; |
280 | 286 | } |
281 | 287 | |
282 | 288 | // If we are streaming to a file but no filename was given drop it in the WP temp dir |
… |
… |
class WP_Http { |
289 | 295 | // Force some settings if we are streaming to a file and check for existence and perms of destination directory |
290 | 296 | $r['blocking'] = true; |
291 | 297 | if ( ! wp_is_writable( dirname( $r['filename'] ) ) ) { |
292 | | return new WP_Error( 'http_request_failed', __( 'Destination directory for file streaming does not exist or is not writable.' ) ); |
| 298 | $response = new WP_Error( 'http_request_failed', __( 'Destination directory for file streaming does not exist or is not writable.' ) ); |
| 299 | /** This action is documented in wp-includes/class-http.php */ |
| 300 | do_action( 'http_api_debug', $response, 'response', 'Requests', $r, $url ); |
| 301 | return $response; |
293 | 302 | } |
294 | 303 | } |
295 | 304 | |