r67672 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67671‎ | r67672 | r67673 >
Date:22:14, 8 June 2010
Author:platonides
Status:ok (Comments)
Tags:
Comment:
MFT 67663-67664 per CR request.
Modified paths:
  • /branches/REL1_16/phase3/includes/HttpFunctions.php (modified) (history)

Diff [purge]

Index: branches/REL1_16/phase3/includes/HttpFunctions.php
@@ -714,8 +714,8 @@
715715 $this->curlOptions[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0;
716716 $this->curlOptions[CURLOPT_WRITEFUNCTION] = $this->callback;
717717 $this->curlOptions[CURLOPT_HEADERFUNCTION] = array($this, "readHeader");
718 - $this->curlOptions[CURLOPT_FOLLOWLOCATION] = $this->followRedirects;
719718 $this->curlOptions[CURLOPT_MAXREDIRS] = $this->maxRedirects;
 719+ $this->curlOptions[CURLOPT_ENCODING] = ""; # Enable compression
720720
721721 /* not sure these two are actually necessary */
722722 if(isset($this->reqHeaders['Referer'])) {
@@ -748,7 +748,13 @@
749749 $this->curlOptions[CURLOPT_HTTPHEADER] = $this->getHeaderList();
750750
751751 $curlHandle = curl_init( $this->url );
752 - curl_setopt_array( $curlHandle, $this->curlOptions );
 752+ if ( !curl_setopt_array( $curlHandle, $this->curlOptions ) ) {
 753+ throw new MWException("Error setting curl options.");
 754+ }
 755+ if ( ! @curl_setopt( $curlHandle, CURLOPT_FOLLOWLOCATION, $this->followRedirects ) ) {
 756+ wfDebug("Couldn't set CURLOPT_FOLLOWLOCATION. Probably safe_mode or open_basedir is set.");
 757+ /* Continue the processing. If it were in curl_setopt_array, processing would have halted on its entry */
 758+ }
753759
754760 if ( false === curl_exec( $curlHandle ) ) {
755761 $code = curl_error( $curlHandle );

Follow-up revisions

RevisionCommit summaryAuthorDate
r67682* Removed release notes for doc-only change r67626...tstarling03:49, 9 June 2010

Comments

#Comment by Tim Starling (talk | contribs)   02:53, 9 June 2010

Please prefix subversion revision numbers with "r" so that CodeReview references will be added.

Status & tagging log