Index: trunk/extensions/Collection/Collection.session.php |
— | — | @@ -109,14 +109,16 @@ |
110 | 110 | static function purge() { |
111 | 111 | $coll = $_SESSION['wsCollection']; |
112 | 112 | $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 { |
117 | 121 | $newitems[] = $item; |
118 | 122 | } |
119 | | - } else { |
120 | | - $newitems[] = $item; |
121 | 123 | } |
122 | 124 | } |
123 | 125 | $coll['items'] = $newitems; |