From f6ecc03881b6bc17106f0dbc92cfaca9960392ff Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 2 Apr 2013 14:18:43 -0400 Subject: [PATCH] Remove non-functional handling of curl_error() Per the docs, curl_error() returns a full error string, not an int or string of an int. Just remove that and pass the error back up. Change-Id: I7434bb2abda056fdee4d670c192b304c0cdf24f7 --- includes/HttpFunctions.php | 13 +------------ languages/messages/MessagesEn.php | 1 - maintenance/language/messages.inc | 1 - 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 4730a973fe..285cdac6c9 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -696,11 +696,6 @@ class MWHttpRequest { class CurlHttpRequest extends MWHttpRequest { const SUPPORTS_FILE_POSTS = true; - static $curlMessageMap = array( - 6 => 'http-host-unreachable', - 28 => 'http-timed-out' - ); - protected $curlOptions = array(); protected $headerText = ""; @@ -780,13 +775,7 @@ class CurlHttpRequest extends MWHttpRequest { } if ( false === curl_exec( $curlHandle ) ) { - $code = curl_error( $curlHandle ); - - if ( isset( self::$curlMessageMap[$code] ) ) { - $this->status->fatal( self::$curlMessageMap[$code] ); - } else { - $this->status->fatal( 'http-curl-error', curl_error( $curlHandle ) ); - } + $this->status->fatal( 'http-curl-error', curl_error( $curlHandle ) ); } else { $this->headerList = explode( "\r\n", $this->headerText ); } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 44b6cc9477..8365dcb131 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2397,7 +2397,6 @@ For optimal security, img_auth.php is disabled.', 'http-read-error' => 'HTTP read error.', 'http-timed-out' => 'HTTP request timed out.', 'http-curl-error' => 'Error fetching URL: $1', -'http-host-unreachable' => 'Could not reach URL.', 'http-bad-status' => 'There was a problem during the HTTP request: $1 $2', # Some likely curl errors. More could be added from diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 9c883bf11e..8361b1b343 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1480,7 +1480,6 @@ $wgMessageStructure = array( 'http-read-error', 'http-timed-out', 'http-curl-error', - 'http-host-unreachable', 'http-bad-status', ), -- 2.20.1