Index: trunk/extensions/NaturalLanguageList/NaturalLanguageList.php |
— | — | @@ -205,15 +205,11 @@ |
206 | 206 | |
207 | 207 | # Remove anything over the set length, if set |
208 | 208 | if ( $this->mOptions['length'] != -1 |
209 | | - && count( $this->mParams ) > $this->mOptions['length'] ) { |
210 | | - while ( count( $this->mParams ) > $this->mOptions['length'] ) |
211 | | - array_pop ( $this->mParams ); |
212 | | - } |
| 209 | + && count( $this->mParams ) > $this->mOptions['length'] ) |
| 210 | + $this->mParams = array_slice( $this->mParams, 0, $this->mOptions['length'] ); |
213 | 211 | |
214 | 212 | # Remove anything over the allowed limit |
215 | | - while ( count( $this->mParams ) > $wgNllMaxListLength ) { |
216 | | - array_pop( $this->mParams ); |
217 | | - } |
| 213 | + $this->mParams = array_slice( $this->mParams, 0, $wgNllMaxListLength ); |
218 | 214 | } |
219 | 215 | |
220 | 216 | /** |