$this->$o = $options[$o];
}
}
+
+ if ( $this->noProxy ) {
+ $this->proxy = ''; // noProxy takes precedence
+ }
}
/**
}
/**
- * Take care of setting up the proxy
- * (override in subclass)
+ * Take care of setting up the proxy (do nothing if "noProxy" is set)
*
- * @return String
+ * @return void
*/
public function proxySetup() {
global $wgHTTPProxy;
- if ( $this->proxy && !$this->noProxy ) {
+ if ( $this->proxy || !$this->noProxy ) {
return;
}
$this->setReferer( wfExpandUrl( $wgTitle->getFullURL(), PROTO_CURRENT ) );
}
- /**
- * Set up the proxy, but
- * clear the proxy when $noProxy is set (takes precedence)
- */
- $this->proxySetup();
+ $this->proxySetup(); // set up any proxy as needed
if ( !$this->callback ) {
$this->setCallback( array( $this, 'read' ) );
}
$options = array();
- if ( $this->proxy && !$this->noProxy ) {
+ if ( $this->proxy ) {
$options['proxy'] = $this->urlToTCP( $this->proxy );
$options['request_fulluri'] = true;
}