Check validity of fetched titles and show a descriptive messages when an invalid title is encountered.
Change-Id: I84804c9d89e778d263c781393afe9c8f70395c99
This commit is contained in:
parent
4acf38255f
commit
43940407d3
1 changed files with 7 additions and 5 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue