CurlHttpRequest: Check library version, not CURLOPT_REDIR_PROTOCOLS
authorKevin Israel <pleasestand@live.com>
Mon, 8 Sep 2014 22:15:09 +0000 (18:15 -0400)
committerKevin Israel <pleasestand@live.com>
Mon, 8 Sep 2014 22:22:50 +0000 (18:22 -0400)
This works around <https://github.com/facebook/hhvm/issues/3702>.
We don't actually use the constant, so checking the library version
should suffice.

Bug: 70570
Change-Id: I732d8f7eb2908bae10100594f693cf7a63f8b5b1

includes/HttpFunctions.php

index 1eb8ca5..8302124 100644 (file)
@@ -809,7 +809,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;
                }