r109586 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109585‎ | r109586 | r109587 >
Date:23:57, 19 January 2012
Author:preilly
Status:ok
Tags:
Comment:
only show sopa banner on wikipedia
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -493,7 +493,7 @@
494494 * @return bool
495495 */
496496 public function beforePageDisplayHTML( &$out, &$text ) {
497 - global $wgContLang, $wgRequest, $wgMemc, $wgUser;
 497+ global $wgContLang, $wgRequest, $wgMemc, $wgUser, $wgConf;
498498 wfProfileIn( __METHOD__ );
499499
500500 $userAgent = $_SERVER['HTTP_USER_AGENT'];
@@ -678,8 +678,12 @@
679679 $this->sendApplicationVersionVaryHeader();
680680 $this->checkUserStatus();
681681 $this->checkUserLoggedIn();
682 -
683 - if (self::$code === 'en') {
 682+
 683+ $DB = wfGetDB( DB_MASTER );
 684+ $DBName = $DB->getDBname();
 685+
 686+ list( $site, $lang ) = $wgConf->siteFromDB( $DBName );
 687+ if ( $site == 'wikipedia' && self::$code === 'en' ) {
684688 self::$displayNoticeId = 2;
685689 }
686690
@@ -1596,7 +1600,7 @@
15971601 $sopaNoticeTemplate = new SopaNoticeTemplate();
15981602 $sopaNoticeTemplate->set( 'messages', self::$messages );
15991603 $noticeHtml = $sopaNoticeTemplate->getHTML();
1600 - }
 1604+ }
16011605 }
16021606
16031607 // header( 'Content-Type: application/xhtml+xml; charset=utf-8' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r1095871.18wmf: MFT r109586preilly23:57, 19 January 2012

Status & tagging log