r60756 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60755‎ | r60756 | r60757 >
Date:00:21, 7 January 2010
Author:tomasz
Status:ok
Tags:
Comment:
adding missing check in case there are no active notices
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialNoticeText.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/SpecialNoticeText.php
@@ -40,18 +40,17 @@
4141 }
4242 }
4343
44 - if ( !$templates ) {
45 - if ( $this->project == 'wikipedia' ) {
 44+ if ( !$templates && $this->project == 'wikipedia' ) {
4645 $notices = CentralNoticeDB::getNotices( 'wikipedia', '', '', '', 1 );
47 - foreach( $notices as $notice => $val ) {
48 - if ( $val['language'] == '' ||
49 - $val['language'] == $this->language ) {
50 - $templates = CentralNoticeDB::selectTemplatesAssigned( $notice );
51 - break;
 46+ if ( $notices ) {
 47+ foreach( $notices as $notice => $val ) {
 48+ if ( $val['language'] == '' ||
 49+ $val['language'] == $this->language ) {
 50+ $templates = CentralNoticeDB::selectTemplatesAssigned( $notice );
 51+ break;
 52+ }
5253 }
5354 }
54 -
55 - }
5655 }
5756
5857 // Didn't find any preferred matches so do an old style lookup

Status & tagging log