r65534 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65533‎ | r65534 | r65535 >
Date:23:12, 25 April 2010
Author:werdna
Status:ok
Tags:
Comment:
MFT r65532
Modified paths:
  • /branches/wmf/1.16wmf4/includes/HttpFunctions.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/includes/HttpFunctions.php
@@ -15,15 +15,17 @@
1616 * @param $method string HTTP method. Usually GET/POST
1717 * @param $url string Full URL to act on
1818 * @param $options options to pass to HttpRequest object
19 - * Possible keys for the array:
20 - * timeout Timeout length in seconds
21 - * postData An array of key-value pairs or a url-encoded form data
22 - * proxy The proxy to use. Will use $wgHTTPProxy (if set) otherwise.
23 - * noProxy Override $wgHTTPProxy (if set) and don't use any proxy at all.
24 - * sslVerifyHost (curl only) Verify the SSL certificate
25 - * caInfo (curl only) Provide CA information
26 - * maxRedirects Maximum number of redirects to follow (defaults to 5)
27 - * followRedirects Whether to follow redirects (defaults to true)
 19+ * Possible keys for the array:
 20+ * timeout Timeout length in seconds
 21+ * postData An array of key-value pairs or a url-encoded form data
 22+ * proxy The proxy to use.
 23+ * Will use $wgHTTPProxy (if set) otherwise.
 24+ * noProxy Override $wgHTTPProxy (if set) and don't use any proxy at all.
 25+ * sslVerifyHost (curl only) Verify hostname against certificate
 26+ * sslVerifyCert (curl only) Verify SSL certificate
 27+ * caInfo (curl only) Provide CA information
 28+ * maxRedirects Maximum number of redirects to follow (defaults to 5)
 29+ * followRedirects Whether to follow redirects (defaults to true)
2830 * @returns mixed (bool)false on failure or a string on success
2931 */
3032 public static function request( $method, $url, $options = array() ) {
@@ -127,6 +129,7 @@
128130 protected $proxy = null;
129131 protected $noProxy = false;
130132 protected $sslVerifyHost = true;
 133+ protected $sslVerifyCert = true;
131134 protected $caInfo = null;
132135 protected $method = "GET";
133136 protected $reqHeaders = array();
@@ -168,7 +171,7 @@
169172 }
170173
171174 $members = array( "postData", "proxy", "noProxy", "sslVerifyHost", "caInfo",
172 - "method", "followRedirects", "maxRedirects" );
 175+ "method", "followRedirects", "maxRedirects", "sslVerifyCert" );
173176 foreach ( $members as $o ) {
174177 if ( isset($options[$o]) ) {
175178 $this->$o = $options[$o];
@@ -726,6 +729,10 @@
727730 if ( isset( $this->sslVerifyHost ) ) {
728731 $this->curlOptions[CURLOPT_SSL_VERIFYHOST] = $this->sslVerifyHost;
729732 }
 733+
 734+ if ( isset( $this->sslVerifyCert ) ) {
 735+ $this->curlOptions[CURLOPT_SSL_VERIFYPEER] = $this->sslVerifyCert;
 736+ }
730737
731738 if ( $this->caInfo ) {
732739 $this->curlOptions[CURLOPT_CAINFO] = $this->caInfo;
Property changes on: branches/wmf/1.16wmf4/includes/HttpFunctions.php
___________________________________________________________________
Modified: svn:mergeinfo
733740 Merged /trunk/phase3/includes/HttpFunctions.php:r65532

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r65532As well as fixing the broken implementation of sslVerifyHost, correct its doc...werdna23:10, 25 April 2010

Status & tagging log