r50384 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50383‎ | r50384 | r50385 >
Date:20:31, 9 May 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
Possible fix for PHP Warning: Wrong parameter count for max()
Modified paths:
  • /trunk/extensions/Translate/tag/TPParse.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/TPParse.php
@@ -31,8 +31,8 @@
3232
3333 $sections = $this->sections;
3434 $highest = 0;
35 - if ( count($this->dbSections) ) {
36 - $highest = call_user_func_array( 'max', array_keys( $this->dbSections ) );
 35+ foreach ( array_keys( $this->dbSections ) as $key ) {
 36+ $highest = max( $highest, $key );
3737 }
3838
3939 foreach ( $sections as $_ ) $highest = max( $_->id, $highest );

Status & tagging log