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)
1  2 
includes/DefaultSettings.php
includes/GlobalFunctions.php

@@@ -2893,6 -2893,11 +2893,6 @@@ $wgShowIPinHeader = true
   */
  $wgSiteNotice = '';
  
 -/**
 - * A subtitle to add to the tagline, for skins that have it/
 - */
 -$wgExtraSubtitle = '';
 -
  /**
   * If this is set, a "donate" link will appear in the sidebar. Set it to a URL.
   */
@@@ -3621,8 -3626,6 +3621,8 @@@ $wgTrackingCategories = array
        'post-expand-template-inclusion-category',
        'hidden-category-category',
        'broken-file-category',
 +      'node-count-exceeded-category',
 +      'expansion-depth-exceeded-category',
  );
  
  /**
@@@ -6186,7 -6189,6 +6186,7 @@@ $wgJobTypesExcludedFromDefaultQueue = a
   * may have a variable number of work items, as is the case with batch jobs.
   * This is used by runJobs.php and not jobs run via $wgJobRunRate.
   * These settings should be global to all wikis.
 + * @var float[]
   */
  $wgJobBackoffThrottling = array();
  
@@@ -7074,6 -7076,14 +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
@@@ -497,7 -497,8 +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 ) {
        }
  
        $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 );
@@@ -1007,14 -1015,14 +1015,14 @@@ function wfDebugTimer() 
  /**
   * Send a line giving PHP memory usage.
   *
 - * @param bool $exact Print exact values instead of kilobytes (default: false)
 + * @param bool $exact Print exact byte values instead of kibibytes (default: false)
   */
  function wfDebugMem( $exact = false ) {
        $mem = memory_get_usage();
        if ( !$exact ) {
 -              $mem = floor( $mem / 1024 ) . ' kilobytes';
 +              $mem = floor( $mem / 1024 ) . ' KiB';
        } else {
 -              $mem .= ' bytes';
 +              $mem .= ' B';
        }
        wfDebug( "Memory usage: $mem\n" );
  }
@@@ -1726,7 -1734,10 +1734,7 @@@ function wfMsgExt( $key, $options ) 
                }
  
                if ( $parseInline ) {
 -                      $m = array();
 -                      if ( preg_match( '/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) {
 -                              $string = $m[1];
 -                      }
 +                      $string = Parser::stripOuterParagraph( $string );
                }
        } elseif ( in_array( 'parsemag', $options, true ) ) {
                $string = $messageCache->transform( $string,
@@@ -2919,10 -2930,8 +2927,10 @@@ function wfShellExec( $cmd, &$retval = 
                $readyPipes = $pipes;
  
                // Clear last error
 +              // @codingStandardsIgnoreStart Generic.PHP.NoSilencedErrors.Discouraged
                @trigger_error( '' );
                if ( @stream_select( $readyPipes, $emptyArray, $emptyArray, null ) === false ) {
 +                      // @codingStandardsIgnoreEnd
                        $error = error_get_last();
                        if ( strncmp( $error['message'], $eintrMessage, strlen( $eintrMessage ) ) == 0 ) {
                                continue;
@@@ -3406,11 -3415,9 +3414,11 @@@ function wfBaseConvert( $input, $source
                        $decimal = bcadd( $decimal, $baseChars[$char] );
                }
  
 +              // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
                for ( $result = ''; bccomp( $decimal, 0 ); $decimal = bcdiv( $decimal, $destBase, 0 ) ) {
                        $result .= $baseChars[bcmod( $decimal, $destBase )];
                }
 +              // @codingStandardsIgnoreEnd
  
                $result = strrev( $result );
        } else {
@@@ -4148,23 -4155,39 +4156,23 @@@ function wfGetIP() 
   * Checks if an IP is a trusted proxy provider.
   * Useful to tell if X-Forwarded-For data is possibly bogus.
   * Squid cache servers for the site are whitelisted.
 + * @deprecated Since 1.24, use IP::isTrustedProxy()
   *
   * @param string $ip
   * @return bool
   */
  function wfIsTrustedProxy( $ip ) {
 -      $trusted = wfIsConfiguredProxy( $ip );
 -      wfRunHooks( 'IsTrustedProxy', array( &$ip, &$trusted ) );
 -      return $trusted;
 +      return IP::isTrustedProxy( $ip );
  }
  
  /**
   * Checks if an IP matches a proxy we've configured.
 + * @deprecated Since 1.24, use IP::isConfiguredProxy()
   *
   * @param string $ip
   * @return bool
   * @since 1.23 Supports CIDR ranges in $wgSquidServersNoPurge
   */
  function wfIsConfiguredProxy( $ip ) {
 -      global $wgSquidServers, $wgSquidServersNoPurge;
 -
 -      // quick check of known proxy servers
 -      $trusted = in_array( $ip, $wgSquidServers )
 -              || in_array( $ip, $wgSquidServersNoPurge );
 -
 -      if ( !$trusted ) {
 -              // slightly slower check to see if the ip is listed directly or in a CIDR
 -              // block in $wgSquidServersNoPurge
 -              foreach ( $wgSquidServersNoPurge as $block ) {
 -                      if ( strpos( $block, '/' ) !== false && IP::isInRange( $ip, $block ) ) {
 -                              $trusted = true;
 -                              break;
 -                      }
 -              }
 -      }
 -      return $trusted;
 +      return IP::isTrustedProxy( $ip );
  }