r64888 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64887‎ | r64888 | r64889 >
Date:17:18, 10 April 2010
Author:svip
Status:deferred
Tags:
Comment:
Accidentally removed some code in r64887, so adding it back.
Modified paths:
  • /trunk/extensions/NaturalLanguageList/NaturalLanguageList.php (modified) (history)

Diff [purge]

Index: trunk/extensions/NaturalLanguageList/NaturalLanguageList.php
@@ -238,15 +238,11 @@
239239
240240 # Remove anything over the set length, if set
241241 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'] );
246244
247245 # 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 );
251247 }
252248
253249 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64887Changes to r64739; moved intervals= option off as a parser function instead c...svip17:15, 10 April 2010

Status & tagging log