Support empty string for wgEmergencyContact/wgPasswordSender
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 31 Aug 2015 15:32:56 +0000 (17:32 +0200)
committerKrinkle <krinklemail@gmail.com>
Wed, 2 Sep 2015 12:10:18 +0000 (12:10 +0000)
In previous versions, the installer often outputted the following
in the generated LocalSettings.php:
> $wgEmergencyContact = '';
> $wgPasswordSender = '';

While this case did not result in providing default values in recent
MediaWiki versions, the mail handling didn't cause an error.

As of MediaWiki 1.25, the error handling is more strict and these
values being empty causes a fatal error and breaks all outgoing mail.

Bug: T104142
Change-Id: Ibf1f857b2f250dac9b725aff8f442e08b8ecd5c9

RELEASE-NOTES-1.26
includes/Setup.php

index 6dcf919..ddf6f7d 100644 (file)
@@ -83,6 +83,8 @@ production.
 * (T53283) load.php sometimes sends 304 response without full headers
 * (T65198) Talk page tabs now have a "rel=discussion" attribute
 * (T98841) {{msgnw:}} now preserves comments even when subst: is not used.
+* (T104142) $wgEmergencyContact and $wgPasswordSender now use their default
+  value if set to an empty string.
 
 === Action API changes in 1.26 ===
 * New-style continuation is now the default for action=continue. Clients may
index 6abef44..479ce8c 100644 (file)
@@ -522,11 +522,11 @@ unset( $serverParts );
 
 // Set defaults for configuration variables
 // that are derived from the server name by default
-if ( $wgEmergencyContact === false ) {
+// Note: $wgEmergencyContact and $wgPasswordSender may be false or empty string (T104142)
+if ( !$wgEmergencyContact ) {
        $wgEmergencyContact = 'wikiadmin@' . $wgServerName;
 }
-
-if ( $wgPasswordSender === false ) {
+if ( !$wgPasswordSender ) {
        $wgPasswordSender = 'apache@' . $wgServerName;
 }