From: Alexandre Emsenhuber Date: Sun, 27 May 2012 17:28:22 +0000 (+0200) Subject: Check validity of fetched titles and show a descriptive messages when an invalid... X-Git-Tag: 1.31.0-rc.0~23490 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=43940407d3fcb4f2de65b012d71c10a7bfc9f41d;p=lhc%2Fweb%2Fwiklou.git Check validity of fetched titles and show a descriptive messages when an invalid title is encountered. Change-Id: I84804c9d89e778d263c781393afe9c8f70395c99 --- diff --git a/includes/specials/SpecialUnwatchedpages.php b/includes/specials/SpecialUnwatchedpages.php index c4f99f89cd..4bd0232d09 100644 --- a/includes/specials/SpecialUnwatchedpages.php +++ b/includes/specials/SpecialUnwatchedpages.php @@ -68,13 +68,15 @@ class UnwatchedpagesPage extends QueryPage { function formatResult( $skin, $result ) { global $wgContLang; - $nt = Title::makeTitle( $result->namespace, $result->title ); + $nt = Title::makeTitleSafe( $result->namespace, $result->title ); + if ( !$nt ) { + return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ), + Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) ); + } + $text = $wgContLang->convert( $nt->getPrefixedText() ); - $plink = Linker::linkKnown( - $nt, - htmlspecialchars( $text ) - ); + $plink = Linker::linkKnown( $nt, htmlspecialchars( $text ) ); $token = WatchAction::getWatchToken( $nt, $this->getUser() ); $wlink = Linker::linkKnown( $nt,