r44062 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44061‎ | r44062 | r44063 >
Date:10:56, 30 November 2008
Author:ialex
Status:deferred
Tags:
Comment:
Check for valid language code
Modified paths:
  • /trunk/extensions/Translate/SpecialLanguageStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/SpecialLanguageStats.php
@@ -34,14 +34,11 @@
3535
3636 $out = '';
3737
38 - #if( $this->including() ) {
39 -# if( isset( Language::getLanguageNames( true ) ) ) {
40 - if( 1 ) {
41 - $out .= $this->getGroupStats( $par );
42 - } else {
43 - $wgOut->addWikiMsg( 'translate-page-no-such-language' );
44 - }
45 - #}
 38+ if( array_key_exists( $par, Language::getLanguageNames() ) ) {
 39+ $out .= $this->getGroupStats( $par );
 40+ } else {
 41+ $wgOut->addWikiMsg( 'translate-page-no-such-language' );
 42+ }
4643 $wgOut->addHTML( $out );
4744 }
4845

Status & tagging log