Tim Starling has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/59787


Change subject: Remove non-functional handling of curl_error()
......................................................................

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: Ic2822e9529feafb5c8c639e482859af4db27496e
---
M includes/HttpFunctions.php
M languages/messages/MessagesEn.php
M maintenance/language/messages.inc
3 files changed, 1 insertion(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/87/59787/1

diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php
index 4730a97..285cdac 100644
--- a/includes/HttpFunctions.php
+++ b/includes/HttpFunctions.php
@@ -696,11 +696,6 @@
 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 @@
                }
 
                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 d95f195..06e67a6 100644
--- a/languages/messages/MessagesEn.php
+++ b/languages/messages/MessagesEn.php
@@ -2397,7 +2397,6 @@
 '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 
<http://curl.haxx.se/libcurl/c/libcurl-errors.html>
diff --git a/maintenance/language/messages.inc 
b/maintenance/language/messages.inc
index 6d6e95c..ce7ffbd 100644
--- a/maintenance/language/messages.inc
+++ b/maintenance/language/messages.inc
@@ -1480,7 +1480,6 @@
                'http-read-error',
                'http-timed-out',
                'http-curl-error',
-               'http-host-unreachable',
                'http-bad-status',
        ),
 

-- 
To view, visit https://gerrit.wikimedia.org/r/59787
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2822e9529feafb5c8c639e482859af4db27496e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf1
Gerrit-Owner: Tim Starling <[email protected]>
Gerrit-Reviewer: Demon <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to