Aude has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/67406


Change subject: Set $wgServer only if $_SERVER['SERVER_NAME'] is available
......................................................................

Set $wgServer only if $_SERVER['SERVER_NAME'] is available

e.g. it is not available on the command line for maintenance scripts and causes

PHP Notice:  Undefined index: SERVER_NAME in /srv/mediawiki/LocalSettings.php 
on line 30

Change-Id: Ice76109582663ebea794b73abf77e6cffab222b9
---
M modules/mediawiki_singlenode/templates/labs-localsettings
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/06/67406/1

diff --git a/modules/mediawiki_singlenode/templates/labs-localsettings 
b/modules/mediawiki_singlenode/templates/labs-localsettings
index 7de451d..63041b9 100644
--- a/modules/mediawiki_singlenode/templates/labs-localsettings
+++ b/modules/mediawiki_singlenode/templates/labs-localsettings
@@ -27,7 +27,9 @@
 # Include the complete settings file generated by mw install
 require_once( 'orig/LocalSettings.php' );
 
-$wgServer = "//" . $_SERVER["SERVER_NAME"];
+if ( array_key_exists( 'SERVER_NAME', $_SERVER ) ) {
+    $wgServer = "//" . $_SERVER["SERVER_NAME"];
+}
 
 if ( ! $wgLogo or $wgLogo == '/wiki/skins/common/images/wiki.png' ) {
     # Logo is either unset or defaulting to the standard wiki logo;

-- 
To view, visit https://gerrit.wikimedia.org/r/67406
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice76109582663ebea794b73abf77e6cffab222b9
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Aude <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to