* @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' );
}
/**
}
$length = strlen( $header );
$matches = [];
- if ( preg_match( "/^(HTTP\/1\.[01]) (\d{3}) (.*)/", $header, $matches ) ) {
+ if ( preg_match( "/^(HTTP\/(?:1\.[01]|2)) (\d{3}) (.*)/", $header, $matches ) ) {
$req['response']['code'] = (int)$matches[2];
$req['response']['reason'] = trim( $matches[3] );
return $length;