* 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)
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,
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;
}