https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113000
Revision: 113000 Author: santhosh Date: 2012-03-05 05:41:01 +0000 (Mon, 05 Mar 2012) Log Message: ----------- Remove invalid language codes from the priority languages. Modified Paths: -------------- trunk/extensions/Translate/tag/SpecialPageTranslation.php Modified: trunk/extensions/Translate/tag/SpecialPageTranslation.php =================================================================== --- trunk/extensions/Translate/tag/SpecialPageTranslation.php 2012-03-05 05:01:28 UTC (rev 112999) +++ trunk/extensions/Translate/tag/SpecialPageTranslation.php 2012-03-05 05:41:01 UTC (rev 113000) @@ -700,6 +700,13 @@ // Normalize $npLangs = array_map( 'trim', explode( ',', $npLangs ) ); $npLangs = array_unique( $npLangs ); + // Remove invalid language codes. + $languages = Language::fetchLanguageNames( null, 'mw' ); + foreach ( $npLangs as $index => $language ) { + if( !array_key_exists( $language, $languages ) ) { + unset( $npLangs[$index] ); + } + } $npLangs = implode( ',', $npLangs ); if ( $npLangs === '' ) { $npLangs = false; _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs