r74007 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74006‎ | r74007 | r74008 >
Date:00:16, 30 September 2010
Author:kaldari
Status:ok
Tags:
Comment:
just in case
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNotice.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/CentralNotice.php
@@ -145,11 +145,13 @@
146146
147147 $centralLoader = SpecialPage::getTitleFor( 'BannerController' )->getLocalUrl();
148148
149 - $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname );
150 - $row = $dbr->selectRow( 'cn_notices', 'not_name', array( 'not_enabled = 1', 'not_geo = 1' ) );
151 - if ( $row ) {
152 - // Insert the geo IP lookup into the <head>
153 - $wgOut->addScriptFile( 'http://geoiplookup.wikimedia.org/' );
 149+ if ( $wgCentralDBname ) {
 150+ $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname );
 151+ $row = $dbr->selectRow( 'cn_notices', 'not_name', array( 'not_enabled = 1', 'not_geo = 1' ) );
 152+ if ( $row ) {
 153+ // Insert the geo IP lookup into the <head>
 154+ $wgOut->addScriptFile( 'http://geoiplookup.wikimedia.org/' );
 155+ }
154156 }
155157
156158 // Insert the banner controller Javascript into the <head>

Status & tagging log