Index: trunk/phase3/includes/HttpFunctions.php |
— | — | @@ -219,6 +219,10 @@ |
220 | 220 | $this->$o = $options[$o]; |
221 | 221 | } |
222 | 222 | } |
| 223 | + |
| 224 | + if ( $this->noProxy ) { |
| 225 | + $this->proxy = ''; // noProxy takes precedence |
| 226 | + } |
223 | 227 | } |
224 | 228 | |
225 | 229 | /** |
— | — | @@ -279,15 +283,14 @@ |
280 | 284 | } |
281 | 285 | |
282 | 286 | /** |
283 | | - * Take care of setting up the proxy |
284 | | - * (override in subclass) |
| 287 | + * Take care of setting up the proxy (do nothing if "noProxy" is set) |
285 | 288 | * |
286 | | - * @return String |
| 289 | + * @return void |
287 | 290 | */ |
288 | 291 | public function proxySetup() { |
289 | 292 | global $wgHTTPProxy; |
290 | 293 | |
291 | | - if ( $this->proxy && !$this->noProxy ) { |
| 294 | + if ( $this->proxy || !$this->noProxy ) { |
292 | 295 | return; |
293 | 296 | } |
294 | 297 | |
— | — | @@ -402,11 +405,7 @@ |
403 | 406 | $this->setReferer( wfExpandUrl( $wgTitle->getFullURL(), PROTO_CURRENT ) ); |
404 | 407 | } |
405 | 408 | |
406 | | - /** |
407 | | - * Set up the proxy, but |
408 | | - * clear the proxy when $noProxy is set (takes precedence) |
409 | | - */ |
410 | | - $this->proxySetup(); |
| 409 | + $this->proxySetup(); // set up any proxy as needed |
411 | 410 | |
412 | 411 | if ( !$this->callback ) { |
413 | 412 | $this->setCallback( array( $this, 'read' ) ); |
— | — | @@ -805,7 +804,7 @@ |
806 | 805 | } |
807 | 806 | |
808 | 807 | $options = array(); |
809 | | - if ( $this->proxy && !$this->noProxy ) { |
| 808 | + if ( $this->proxy ) { |
810 | 809 | $options['proxy'] = $this->urlToTCP( $this->proxy ); |
811 | 810 | $options['request_fulluri'] = true; |
812 | 811 | } |