From e9b95e43b8711959d8d6e6c4bfc5d1a139daf32b Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 4 Sep 2008 06:37:51 +0000 Subject: [PATCH] Ignore invalid titles in $out->getLanguageLinks(). --- includes/SkinTemplate.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 9d766307e5..62d211d13b 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -413,11 +413,13 @@ class SkinTemplate extends Skin { $class = 'interwiki-' . $tmp[0]; unset($tmp); $nt = Title::newFromText( $l ); - $language_urls[] = array( - 'href' => $nt->getFullURL(), - 'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l), - 'class' => $class - ); + if ( $nt ) { + $language_urls[] = array( + 'href' => $nt->getFullURL(), + 'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l), + 'class' => $class + ); + } } } if(count($language_urls)) { -- 2.20.1