git-svn-id: https://develop.svn.wordpress.org/trunk@8545 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
89223e4a84
commit
973a10982b
|
@ -542,9 +542,15 @@ class WP_Http_Fopen {
|
||||||
|
|
||||||
$arrURL = parse_url($url);
|
$arrURL = parse_url($url);
|
||||||
|
|
||||||
|
if ( false === $arrURL )
|
||||||
|
return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url));
|
||||||
|
|
||||||
if ( 'http' != $arrURL['scheme'] || 'https' != $arrURL['scheme'] )
|
if ( 'http' != $arrURL['scheme'] || 'https' != $arrURL['scheme'] )
|
||||||
$url = str_replace($arrURL['scheme'], 'http', $url);
|
$url = str_replace($arrURL['scheme'], 'http', $url);
|
||||||
|
|
||||||
|
if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )
|
||||||
|
$handle = @fopen($url, 'r');
|
||||||
|
else
|
||||||
$handle = fopen($url, 'r');
|
$handle = fopen($url, 'r');
|
||||||
|
|
||||||
if (! $handle)
|
if (! $handle)
|
||||||
|
@ -637,6 +643,9 @@ class WP_Http_Streams {
|
||||||
|
|
||||||
$arrURL = parse_url($url);
|
$arrURL = parse_url($url);
|
||||||
|
|
||||||
|
if ( false === $arrURL )
|
||||||
|
return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url));
|
||||||
|
|
||||||
if ( 'http' != $arrURL['scheme'] || 'https' != $arrURL['scheme'] )
|
if ( 'http' != $arrURL['scheme'] || 'https' != $arrURL['scheme'] )
|
||||||
$url = str_replace($arrURL['scheme'], 'http', $url);
|
$url = str_replace($arrURL['scheme'], 'http', $url);
|
||||||
|
|
||||||
|
@ -656,7 +665,10 @@ class WP_Http_Streams {
|
||||||
|
|
||||||
$context = stream_context_create($arrContext);
|
$context = stream_context_create($arrContext);
|
||||||
|
|
||||||
$handle = fopen($url, 'r', false, $context);
|
if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )
|
||||||
|
$handle = @fopen($url, 'r');
|
||||||
|
else
|
||||||
|
$handle = fopen($url, 'r');
|
||||||
|
|
||||||
if ( ! $handle)
|
if ( ! $handle)
|
||||||
return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url));
|
return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url));
|
||||||
|
|
Loading…
Reference in New Issue