r92174 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92173‎ | r92174 | r92175 >
Date:18:26, 14 July 2011
Author:robin
Status:ok (Comments)
Tags:
Comment:
Fix PHP notice undefined index
Modified paths:
  • /trunk/extensions/SiteMatrix/SiteMatrix_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SiteMatrix/SiteMatrix_body.php
@@ -336,7 +336,7 @@
337337 $attribs['title'] = $localLanguageNames[$lang];
338338 }
339339
340 - $langDisplay = $langNames[$lang];
 340+ $langDisplay = ( isset( $langNames[$lang] ) ? $langNames[$lang] : '' );
341341 if ( isset( $localLanguageNames[$lang] ) && strlen( $localLanguageNames[$lang] ) && $langDisplay != $localLanguageNames[$lang] ) {
342342 $langDisplay .= ' (' . $localLanguageNames[$lang] . ')';
343343 }

Comments

#Comment by IAlex (talk | contribs)   18:52, 14 July 2011

Parenthesis are not needed ;)

#Comment by SPQRobin (talk | contribs)   22:05, 15 July 2011

I know, but I usually add them always, so I don't forget them when they *are* needed :-)

Status & tagging log