* $wgInternalServer = 'http://yourinternal.tld:8000';
* </code>
*/
-$wgInternalServer = $wgServer;
+$wgInternalServer = false;
/**
* Cache timeout for the squid, will be sent as s-maxage (without ESI) or
* @return string
*/
static function expand( $url ) {
- global $wgInternalServer;
- if( $url != '' && $url{0} == '/' ) {
- return $wgInternalServer . $url;
+ global $wgInternalServer, $wgServer;
+ $server = $wgInternalServer !== false ? $wgInternalServer : $wgServer;
+ if( $url !== '' && $url[0] == '/' ) {
+ return $server . $url;
}
return $url;
}
* @return String the URL
*/
public function getInternalURL( $query = '', $variant = false ) {
- global $wgInternalServer;
- $url = $wgInternalServer . $this->getLocalURL( $query, $variant );
+ global $wgInternalServer, $wgServer;
+ $server = $wgInternalServer !== false ? $wgInternalServer : $wgServer;
+ $url = $server . $this->getLocalURL( $query, $variant );
wfRunHooks( 'GetInternalURL', array( &$this, &$url, $query ) );
return $url;
}