jenkins-bot has submitted this change and it was merged.
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: I7434bb2abda056fdee4d670c192b304c0cdf24f7
---
M includes/HttpFunctions.php
M languages/messages/MessagesEn.php
M maintenance/language/messages.inc
3 files changed, 1 insertion(+), 14 deletions(-)
Approvals:
Aaron Schulz: Looks good to me, approved
Ram: Looks good to me, but someone else must approve
jenkins-bot: Verified
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 44b6cc9..8365dcb 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 9c883bf..8361b1b 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/57097
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7434bb2abda056fdee4d670c192b304c0cdf24f7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Demon <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Ram <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits