Merge "Make HTTPS port configurable"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 23 May 2014 22:47:03 +0000 (22:47 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 23 May 2014 22:47:03 +0000 (22:47 +0000)
includes/DefaultSettings.php
includes/GlobalFunctions.php

index e011d4a..796e0c0 100644 (file)
@@ -7074,6 +7074,14 @@ $wgCompiledFiles = array();
  */
 $wgPagePropsHaveSortkey = true;
 
+/**
+ * Port where you have HTTPS running
+ * Supports HTTPS on non-standard ports
+ * @see bug 65184
+ * @since 1.24
+ */
+$wgHttpsPort = 443;
+
 /**
  * For really cool vim folding this needs to be at the end:
  * vim: foldmarker=@{,@} foldmethod=marker
index d2c7542..9cbb9d6 100644 (file)
@@ -497,7 +497,8 @@ function wfAppendQuery( $url, $query ) {
  *    no valid URL can be constructed
  */
 function wfExpandUrl( $url, $defaultProto = PROTO_CURRENT ) {
-       global $wgServer, $wgCanonicalServer, $wgInternalServer, $wgRequest;
+       global $wgServer, $wgCanonicalServer, $wgInternalServer, $wgRequest,
+               $wgHttpsPort;
        if ( $defaultProto === PROTO_CANONICAL ) {
                $serverUrl = $wgCanonicalServer;
        } elseif ( $defaultProto === PROTO_INTERNAL && $wgInternalServer !== false ) {
@@ -536,6 +537,13 @@ function wfExpandUrl( $url, $defaultProto = PROTO_CURRENT ) {
        }
 
        $bits = wfParseUrl( $url );
+
+       // ensure proper port for HTTPS arrives in URL
+       // https://bugzilla.wikimedia.org/show_bug.cgi?id=65184
+       if ( $defaultProto === PROTO_HTTPS && $wgHttpsPort != 443 ) {
+               $bits['port'] = $wgHttpsPort;
+       }
+
        if ( $bits && isset( $bits['path'] ) ) {
                $bits['path'] = wfRemoveDotSegments( $bits['path'] );
                return wfAssembleUrl( $bits );