X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FHttpFunctions.php;h=f9ee14bbd938cbdd30bea4ea7fc15e8a2a9ed168;hb=6df6968d20c01c00ccb1431811b462f8d0711ece;hp=1eb8ca52948f4515a2e4bdaaf973d11b4155934e;hpb=aa59d1955dd2df9a3c7f125f1717102f64432da9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 1eb8ca5294..f9ee14bbd9 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -114,7 +114,7 @@ class Http { * @return bool */ public static function isLocalURL( $url ) { - global $wgCommandLineMode, $wgConf; + global $wgCommandLineMode, $wgLocalVirtualHosts, $wgConf; if ( $wgCommandLineMode ) { return false; @@ -126,7 +126,7 @@ class Http { $host = $matches[1]; // Split up dotwise $domainParts = explode( '.', $host ); - // Check if this domain or any superdomain is listed in $wgConf as a local virtual host + // Check if this domain or any superdomain is listed as a local virtual host $domainParts = array_reverse( $domainParts ); $domain = ''; @@ -139,7 +139,9 @@ class Http { $domain = $domainPart . '.' . $domain; } - if ( $wgConf->isLocalVHost( $domain ) ) { + if ( in_array( $domain, $wgLocalVirtualHosts ) + || $wgConf->isLocalVHost( $domain ) + ) { return true; } } @@ -809,7 +811,8 @@ class CurlHttpRequest extends MWHttpRequest { return false; } - if ( !defined( 'CURLOPT_REDIR_PROTOCOLS' ) ) { + $curlVersionInfo = curl_version(); + if ( $curlVersionInfo['version_number'] < 0x071304 ) { wfDebug( "Cannot follow redirects with libcurl < 7.19.4 due to CVE-2009-0037\n" ); return false; }