r108815 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108814‎ | r108815 | r108816 >
Date:16:25, 13 January 2012
Author:nikerabbit
Status:ok
Tags:
Comment:
Special:PageTranslation could in some occasions suggest duplicate keys for translation units, because the existing keys were strings "1" and not numbers 1
Modified paths:
  • /trunk/extensions/Translate/tag/TPParse.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/TPParse.php
@@ -76,13 +76,11 @@
7777 $sections = $this->sections;
7878 $highest = 0;
7979 foreach ( array_keys( $this->dbSections ) as $key ) {
80 - if ( !is_int( $key ) ) continue;
81 - $highest = max( $highest, $key );
 80+ $highest = max( $highest, intval( $key ) );
8281 }
8382
8483 foreach ( $sections as $_ ) {
85 - if ( !is_int( $_->id ) ) continue;
86 - $highest = max( $_->id, $highest );
 84+ $highest = max( $highest, intval( $_->id ) );
8785 }
8886
8987 foreach ( $sections as $s ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r109052MFT r108608 r108660 r108792 r108815 r108816nikerabbit18:40, 16 January 2012

Status & tagging log