Fixed spacing
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 1eb5c3e..57877a2 100644 (file)
@@ -496,17 +496,18 @@ function wfAppendQuery( $url, $query ) {
  */
 function wfExpandUrl( $url, $defaultProto = PROTO_CURRENT ) {
        global $wgServer, $wgCanonicalServer, $wgInternalServer, $wgRequest;
-       $serverUrl = $wgServer;
        if ( $defaultProto === PROTO_CANONICAL ) {
                $serverUrl = $wgCanonicalServer;
-       }
-       // Make $wgInternalServer fall back to $wgServer if not set
-       if ( $defaultProto === PROTO_INTERNAL && $wgInternalServer !== false ) {
+       } elseif ( $defaultProto === PROTO_INTERNAL && $wgInternalServer !== false ) {
+               // Make $wgInternalServer fall back to $wgServer if not set
                $serverUrl = $wgInternalServer;
+       } else {
+               $serverUrl = $wgServer;
+               if ( $defaultProto === PROTO_CURRENT ) {
+                       $defaultProto = $wgRequest->getProtocol() . '://';
+               }
        }
-       if ( $defaultProto === PROTO_CURRENT ) {
-               $defaultProto = $wgRequest->getProtocol() . '://';
-       }
+
 
        // Analyze $serverUrl to obtain its protocol
        $bits = wfParseUrl( $serverUrl );
@@ -3809,7 +3810,7 @@ function wfGetNull() {
  * @param string|bool $cluster Cluster name accepted by LBFactory. Default: false.
  */
 function wfWaitForSlaves( $maxLag = false, $wiki = false, $cluster = false ) {
-       if( $cluster !== false ) {
+       if ( $cluster !== false ) {
                $lb = wfGetLBFactory()->getExternalLB( $cluster );
        } else {
                $lb = wfGetLB( $wiki );