Check validity of fetched titles and show a descriptive messages when an invalid title is encountered.

Change-Id: I84804c9d89e778d263c781393afe9c8f70395c99
This commit is contained in:
Alexandre Emsenhuber 2012-05-27 19:28:22 +02:00
parent 4acf38255f
commit 43940407d3

View file

@ -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,