Index: trunk/extensions/Translate/specials/SpecialMessageGroupStats.php |
— | — | @@ -36,9 +36,12 @@ |
37 | 37 | } |
38 | 38 | |
39 | 39 | /// Overwritten from SpecialLanguageStats |
40 | | - protected function getAllowedValues() { |
41 | | - $groups = MessageGroups::getAllGroups(); |
42 | | - return array_keys( $groups ); |
| 40 | + protected function isValidValue( $value ) { |
| 41 | + $group = MessageGroups::getGroup( $value ); |
| 42 | + if ( $group ) { |
| 43 | + $this->target = $group->getId(); |
| 44 | + } |
| 45 | + return (bool) $group; |
43 | 46 | } |
44 | 47 | |
45 | 48 | /// Overwritten from SpecialLanguageStats |
Index: trunk/extensions/Translate/specials/SpecialLanguageStats.php |
— | — | @@ -124,8 +124,7 @@ |
125 | 125 | $wgOut->addHTML( $this->getForm() ); |
126 | 126 | } |
127 | 127 | |
128 | | - $allowedValues = $this->getAllowedValues(); |
129 | | - if ( in_array( $this->target, $allowedValues, true ) ) { |
| 128 | + if ( $this->isValidValue( $this->target ) ) { |
130 | 129 | $this->outputIntroduction(); |
131 | 130 | $output = $this->getTable(); |
132 | 131 | if ( $this->incomplete ) { |
— | — | @@ -145,9 +144,9 @@ |
146 | 145 | * Return the list of allowed values for target here. |
147 | 146 | * @return array |
148 | 147 | */ |
149 | | - protected function getAllowedValues() { |
| 148 | + protected function isValidValue( $value ) { |
150 | 149 | $langs = Language::getLanguageNames( false ); |
151 | | - return array_keys( $langs ); |
| 150 | + return isset( $langs[$value] ); |
152 | 151 | } |
153 | 152 | |
154 | 153 | /// Called when the target is unknown. |