BryanDavis has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/179554

Change subject: Guard against undefined index when expanding langauge code
......................................................................

Guard against undefined index when expanding langauge code

Avoid causing an undefined index warning if the localized name for
a given language code is not present. This error has been seen in WMF
production for language codes including: als, bat-smg, be-x-old, bh,
fiu-vro, no, roa-rup, simple, zh-classical, zh-min-nan, zh-yue.

Change-Id: I37f63529da979373cc40778733a84e3832a09002
---
M specials/SpecialMessageGroupStats.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/54/179554/1

diff --git a/specials/SpecialMessageGroupStats.php 
b/specials/SpecialMessageGroupStats.php
index 901b723..dd515e1 100644
--- a/specials/SpecialMessageGroupStats.php
+++ b/specials/SpecialMessageGroupStats.php
@@ -278,7 +278,11 @@
                        'language' => $code
                );
 
-               $text = htmlspecialchars( "$code: {$this->names[$code]}" );
+               if ( isset( $this->names[$code] ) ) {
+                       $text = htmlspecialchars( "$code: 
{$this->names[$code]}" );
+               } else {
+                       $text = htmlspecialchars( $code );
+               }
                $link = Linker::link( $this->translate, $text, array(), 
$queryParameters );
 
                return Html::rawElement( 'td', array(), $link );

-- 
To view, visit https://gerrit.wikimedia.org/r/179554
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I37f63529da979373cc40778733a84e3832a09002
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to