Index: trunk/extensions/NaturalLanguageList/NaturalLanguageList.php |
— | — | @@ -238,15 +238,11 @@ |
239 | 239 | |
240 | 240 | # Remove anything over the set length, if set |
241 | 241 | if ( $this->mOptions['length'] != -1 |
242 | | - && count( $this->mParams ) > $this->mOptions['length'] ) { |
243 | | - while ( count( $this->mParams ) > $this->mOptions['length'] ) |
244 | | - array_pop ( $this->mParams ); |
245 | | - } |
| 242 | + && count( $this->mParams ) > $this->mOptions['length'] ) |
| 243 | + $this->mParams = array_slice( $this->mParams, 0, $this->mOptions['length'] ); |
246 | 244 | |
247 | 245 | # Remove anything over the allowed limit |
248 | | - while ( count( $this->mParams ) > $wgNllMaxListLength ) { |
249 | | - array_pop( $this->mParams ); |
250 | | - } |
| 246 | + $this->mParams = array_slice( $this->mParams, 0, $wgNllMaxListLength ); |
251 | 247 | } |
252 | 248 | |
253 | 249 | /** |