Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php |
— | — | @@ -700,6 +700,13 @@ |
701 | 701 | // Normalize |
702 | 702 | $npLangs = array_map( 'trim', explode( ',', $npLangs ) ); |
703 | 703 | $npLangs = array_unique( $npLangs ); |
| 704 | + // Remove invalid language codes. |
| 705 | + $languages = Language::fetchLanguageNames( null, 'mw' ); |
| 706 | + foreach ( $npLangs as $index => $language ) { |
| 707 | + if( !array_key_exists( $language, $languages ) ) { |
| 708 | + unset( $npLangs[$index] ); |
| 709 | + } |
| 710 | + } |
704 | 711 | $npLangs = implode( ',', $npLangs ); |
705 | 712 | if ( $npLangs === '' ) { |
706 | 713 | $npLangs = false; |