From 583fdd54ad14d3b8a5efc57069f89474c9f8362e Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Mon, 31 Aug 2015 17:32:56 +0200 Subject: [PATCH] Support empty string for wgEmergencyContact/wgPasswordSender 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 | 2 ++ includes/Setup.php | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES-1.26 b/RELEASE-NOTES-1.26 index 6dcf9195a1..ddf6f7dc59 100644 --- a/RELEASE-NOTES-1.26 +++ b/RELEASE-NOTES-1.26 @@ -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 diff --git a/includes/Setup.php b/includes/Setup.php index 6abef44831..479ce8c32a 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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; } -- 2.20.1