[Mediawiki-l] Problem with spurious :443s

Doug Fields dfields-mediawiki-200502 at pexicom.com
Sun Feb 13 18:46:23 UTC 2005

Hello all,

MediaWiki 1.4beta6

I had a problem with the application putting :443 in each https link. 
There's an easy fix in DefaultSettings.php, by modifying the code which 
determines a reasonable default for $wgServer (or simply overriding the 
default in LocalSettings.php with $wgServer, which was not as elegant):

if (isset( $_SERVER['SERVER_PORT'] )) {
         if ($_SERVER['SERVER_PORT'] != 80)
                 if ($wgProto == 'https' && $_SERVER['SERVER_PORT'] == 
                         // If we're using HTTPS, don't add a port
                         $wgServer .= "";
                         $wgServer .= ":" . $_SERVER['SERVER_PORT'];

This goes right before the unset($wgProto); line in place of the 
previous if clause.

Someone who cares more can make the innermost-IF clause more elegant by 
not having an effectively null statement.



More information about the MediaWiki-l mailing list