r65567 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65566‎ | r65567 | r65568 >
Date:09:02, 27 April 2010
Author:jojo
Status:ok
Tags:
Comment:
repair broken array()
Modified paths:
  • /trunk/extensions/Collection/Collection.session.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.session.php
@@ -109,14 +109,16 @@
110110 static function purge() {
111111 $coll = $_SESSION['wsCollection'];
112112 $newitems = array();
113 - foreach ( $coll['items'] as $index => $item ) {
114 - if ( $item['type'] == 'article' ) {
115 - $t = Title::newFromText( $item['title'] );
116 - if ( $t->exists() ) {
 113+ if ( isset( $coll['items'] ) ) {
 114+ foreach ( $coll['items'] as $index => $item ) {
 115+ if ( $item['type'] == 'article' ) {
 116+ $t = Title::newFromText( $item['title'] );
 117+ if ( $t->exists() ) {
 118+ $newitems[] = $item;
 119+ }
 120+ } else {
117121 $newitems[] = $item;
118122 }
119 - } else {
120 - $newitems[] = $item;
121123 }
122124 }
123125 $coll['items'] = $newitems;

Status & tagging log