Merge "Remove 'move' from LogPage::getTitleLink"
[lhc/web/wiklou.git] / includes / HttpFunctions.php
index c9dd0c0..8302124 100644 (file)
@@ -36,8 +36,8 @@ class Http {
         * Perform an HTTP request
         *
         * @param string $method HTTP method. Usually GET/POST
-        * @param string $url full URL to act on. If protocol-relative, will be expanded to an http:// URL
-        * @param array $options options to pass to MWHttpRequest object.
+        * @param string $url Full URL to act on. If protocol-relative, will be expanded to an http:// URL
+        * @param array $options Options to pass to MWHttpRequest object.
         *      Possible keys for the array:
         *    - timeout             Timeout length in seconds
         *    - connectTimeout      Timeout for connection, in seconds (curl only)
@@ -772,7 +772,7 @@ class CurlHttpRequest extends MWHttpRequest {
 
                if ( $this->followRedirects && $this->canFollowRedirects() ) {
                        wfSuppressWarnings();
-                       if ( ! curl_setopt( $curlHandle, CURLOPT_FOLLOWLOCATION, true ) ) {
+                       if ( !curl_setopt( $curlHandle, CURLOPT_FOLLOWLOCATION, true ) ) {
                                wfDebug( __METHOD__ . ": Couldn't set CURLOPT_FOLLOWLOCATION. " .
                                        "Probably safe_mode or open_basedir is set.\n" );
                                // Continue the processing. If it were in curl_setopt_array,
@@ -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;
                }