r112920 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112919‎ | r112920 | r112921 >
Date:21:12, 2 March 2012
Author:nikerabbit
Status:ok
Tags:
Comment:
Third time the bunny jumps, ping r112917, r112919
Modified paths:
  • /trunk/extensions/Translate/specials/SpecialTranslate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/specials/SpecialTranslate.php
@@ -141,11 +141,13 @@
142142 $description = $status . $description;
143143 }
144144
145 - $priorityLangs = TranslateMetadata::get( $this->group->getId(), 'prioritylangs' );
146 - if ( $priorityLangs !== false && !isset( $priorityLangs[$this->options['language']] ) ) {
147 - $priorityLangs = array_flip( explode( ',', $priorityLangs ) );
148 - $priorityForce = TranslateMetadata::get( $this->group->getId(), 'priorityforce' );
149 - $priorityReason = TranslateMetadata::get( $this->group->getId(), 'priorityreason' );
 145+ $groupId = $this->group->getId();
 146+ // PHP is such an awesome language
 147+ $priorityLangs = TranslateMetadata::get( $groupId, 'prioritylangs' );
 148+ $priorityLangs = array_flip( array_filter( explode( ',', $priorityLangs ) ) );
 149+ if ( count( $priorityLangs) && !isset( $priorityLangs[$this->options['language']] ) ) {
 150+ $priorityForce = TranslateMetadata::get( $groupId, 'priorityforce' );
 151+ $priorityReason = TranslateMetadata::get( $groupId, 'priorityreason' );
150152 if ( $priorityForce === 'on' ) {
151153 // Hide table
152154 $this->paging['count'] = 0;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112917I break it I fix itnikerabbit20:48, 2 March 2012
r112919Apparently someone thinks that explode( ',', '' ) returning array( 0 => '' ) ...nikerabbit21:02, 2 March 2012

Status & tagging log