r60996 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60995‎ | r60996 | r60997 >
Date:23:50, 12 January 2010
Author:dale
Status:deferred
Tags:
Comment:
* update to r60811 to check ->proxy for "ignore" / false condition for php upload
Modified paths:
  • /branches/js2-work/phase3/includes/HttpFunctions.php (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/includes/HttpFunctions.php
@@ -11,7 +11,7 @@
1212 // Syncronous download (in a single request)
1313 const SYNC_DOWNLOAD = 1;
1414
15 - // Asynchronous download ( background process with multiple requests )
 15+ // Asynchronous download ( background process with multiple status requests )
1616 const ASYNC_DOWNLOAD = 2;
1717
1818 /**
@@ -66,7 +66,7 @@
6767 }
6868 $head = $headResponse->value;
6969
70 - // check for redirects:
 70+ // Check for redirects:
7171 if( isset( $head['Location'] ) && strrpos( $head[0], '302' ) !== false ) {
7272 if( $redirectCount < $wgMaxRedirects ) {
7373 if( self::isValidURI( $head['Location'] ) ) {
@@ -92,7 +92,7 @@
9393 }
9494 }
9595
96 - // check if we can find phpCliPath (for doing a background shell request to
 96+ // Check if we can find $wgPhpCli (for doing a background shell request to
9797 // php to do the download:
9898 if( $wgPhpCli && wfShellExecEnabled() && $dl_mode == self::ASYNC_DOWNLOAD ) {
9999 wfDebug( __METHOD__ . "\nASYNC_DOWNLOAD\n" );
@@ -528,12 +528,15 @@
529529 );
530530
531531 // Proxy setup:
532 - if( $this->proxy ){
533 - $httpContextOptions['proxy'] = 'tcp://' . $this->proxy;
534 - }else if ( Http::isLocalURL( $this->url ) ) {
535 - $httpContextOptions['proxy'] = 'tcp://localhost:80';
536 - } elseif ( $wgHTTPProxy ) {
537 - $httpContextOptions['proxy'] = 'tcp://' . $wgHTTPProxy ;
 532+ // only do proxy setup if ( not suppressed $this->proxy === false )
 533+ if( $this->proxy !== false ){
 534+ if( $this->proxy ){
 535+ $httpContextOptions['proxy'] = 'tcp://' . $this->proxy;
 536+ }else if ( Http::isLocalURL( $this->url ) ) {
 537+ $httpContextOptions['proxy'] = 'tcp://localhost:80';
 538+ } elseif ( $wgHTTPProxy ) {
 539+ $httpContextOptions['proxy'] = 'tcp://' . $wgHTTPProxy ;
 540+ }
538541 }
539542
540543 $fcontext = stream_context_create (

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60811* fix for bug 20512 ( in both trunk and js2-work branch )...dale21:57, 7 January 2010

Status & tagging log