Don't return truncated output
This commit is contained in:
parent
6518faf7f5
commit
697c6b32b4
1 changed files with 5 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ class Http {
|
|||
static function request( $method, $url, $timeout = 'default' ) {
|
||||
global $wgHTTPTimeout, $wgHTTPProxy, $wgVersion, $wgTitle;
|
||||
|
||||
wfDebug( __METHOD__ . ": $method $url\n" );
|
||||
# Use curl if available
|
||||
if ( function_exists( 'curl_init' ) ) {
|
||||
$c = curl_init( $url );
|
||||
|
|
@ -57,6 +58,10 @@ class Http {
|
|||
if ( curl_getinfo( $c, CURLINFO_HTTP_CODE ) != 200 ) {
|
||||
$text = false;
|
||||
}
|
||||
# Don't return truncated output
|
||||
if ( curl_errno( $c ) != CURLE_OK ) {
|
||||
$text = false;
|
||||
}
|
||||
curl_close( $c );
|
||||
} else {
|
||||
# Otherwise use file_get_contents...
|
||||
|
|
|
|||
Loading…
Reference in a new issue