Index: trunk/extensions/CentralNotice/SpecialNoticeText.php |
— | — | @@ -40,18 +40,17 @@ |
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | | - if ( !$templates ) { |
45 | | - if ( $this->project == 'wikipedia' ) { |
| 44 | + if ( !$templates && $this->project == 'wikipedia' ) { |
46 | 45 | $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 | + } |
52 | 53 | } |
53 | 54 | } |
54 | | - |
55 | | - } |
56 | 55 | } |
57 | 56 | |
58 | 57 | // Didn't find any preferred matches so do an old style lookup |