Undefined variable: attrs in HistoryAction.php on line 202
[lhc/web/wiklou.git] / includes / HttpFunctions.php
index 1eb8ca5..f9ee14b 100644 (file)
@@ -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;
                }