From: James D. Forrester Date: Wed, 15 Apr 2020 19:34:51 +0000 (-0700) Subject: MultiHttpClient: Also fallover to non-curl if curl_multi* is blocked X-Git-Tag: 1.34.2~17^2 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=da148b501044824b930db83234718a1341f072a1;hp=d29905ee342c00661b1b9f019f74c7de1b1ec962;p=lhc%2Fweb%2Fwiklou.git MultiHttpClient: Also fallover to non-curl if curl_multi* is blocked Requested by a user at https://www.mediawiki.org/wiki/Topic:Vkk1ahk3eggd9747 for whom their hoster provides curl but with multi-threaded functions removed for some reason. Change-Id: Id3877c600ae02feffb67f74a815430f8e679230a (cherry picked from commit 1c241419914d1203ea90eeea6a41d76f4a2ecbec) --- diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index 3b5def59cc..d035653201 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -5,6 +5,7 @@ THIS IS NOT A RELEASE YET === Changes since MediaWiki 1.34.1 === +* The MultiHttpClient code will fallover to non-curl if curl_multi* is blocked. == MediaWiki 1.34.1 == diff --git a/includes/libs/http/MultiHttpClient.php b/includes/libs/http/MultiHttpClient.php index b0c8a8b438..85959d6883 100644 --- a/includes/libs/http/MultiHttpClient.php +++ b/includes/libs/http/MultiHttpClient.php @@ -176,7 +176,9 @@ class MultiHttpClient implements LoggerAwareInterface { * @return bool true if curl is available, false otherwise. */ protected function isCurlEnabled() { - return extension_loaded( 'curl' ); + // Explicitly test if curl_multi* is blocked, as some users' hosts provide + // them with a modified curl with the multi-threaded parts removed(!) + return extension_loaded( 'curl' ) && function_exists( 'curl_multi_init' ); } /**