Don use has_action() before do_action() in http.php, props Viper007Bond, fixes #10625

git-svn-id: https://develop.svn.wordpress.org/trunk@11835 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2009-08-16 22:43:48 +00:00
parent 1b1683c1ed
commit 49de179229
1 changed files with 4 additions and 8 deletions

View File

@ -118,8 +118,7 @@ class WP_Http {
} }
} }
if ( has_filter('http_transport_get_debug') ) do_action( 'http_transport_get_debug', $working_transport, $blocking_transport, $nonblocking_transport );
do_action('http_transport_get_debug', $working_transport, $blocking_transport, $nonblocking_transport);
if ( isset($args['blocking']) && !$args['blocking'] ) if ( isset($args['blocking']) && !$args['blocking'] )
return $nonblocking_transport; return $nonblocking_transport;
@ -166,8 +165,7 @@ class WP_Http {
} }
} }
if ( has_filter('http_transport_post_debug') ) do_action( 'http_transport_post_debug', $working_transport, $blocking_transport, $nonblocking_transport );
do_action('http_transport_post_debug', $working_transport, $blocking_transport, $nonblocking_transport);
if ( isset($args['blocking']) && !$args['blocking'] ) if ( isset($args['blocking']) && !$args['blocking'] )
return $nonblocking_transport; return $nonblocking_transport;
@ -300,15 +298,13 @@ class WP_Http {
$transports = WP_Http::_postTransport($r); $transports = WP_Http::_postTransport($r);
} }
if ( has_action('http_api_debug') ) do_action( 'http_api_debug', $transports, 'transports_list' );
do_action('http_api_debug', $transports, 'transports_list');
$response = array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); $response = array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() );
foreach ( (array) $transports as $transport ) { foreach ( (array) $transports as $transport ) {
$response = $transport->request($url, $r); $response = $transport->request($url, $r);
if ( has_action('http_api_debug') ) do_action( 'http_api_debug', $response, 'response', get_class($transport) );
do_action( 'http_api_debug', $response, 'response', get_class($transport) );
if ( ! is_wp_error($response) ) if ( ! is_wp_error($response) )
return apply_filters( 'http_response', $response, $r, $url ); return apply_filters( 'http_response', $response, $r, $url );