Set $wgInternalServer to false by default, and fall back to $wgServer in the referrin...
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 8 Mar 2011 06:38:15 +0000 (06:38 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 8 Mar 2011 06:38:15 +0000 (06:38 +0000)
includes/DefaultSettings.php
includes/SquidUpdate.php
includes/Title.php

index aabab5b..339dc03 100644 (file)
@@ -1768,7 +1768,7 @@ $wgUseXVO = false;
  * $wgInternalServer = 'http://yourinternal.tld:8000';
  * </code>
  */
-$wgInternalServer = $wgServer;
+$wgInternalServer = false;
 
 /**
  * Cache timeout for the squid, will be sent as s-maxage (without ESI) or
index 31f7aa6..91f1d28 100644 (file)
@@ -193,9 +193,10 @@ class SquidUpdate {
         * @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;
        }
index 59a0803..a992bc9 100644 (file)
@@ -990,8 +990,9 @@ class Title {
         * @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;
        }