From: Alexandre Emsenhuber Date: Fri, 25 May 2012 17:34:43 +0000 (+0200) Subject: Check validity of fetched titles and show a descriptive messages when an invalid... X-Git-Tag: 1.31.0-rc.0~23316^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=3cf68bc3f6f34e2e76e3af8764a9d62873d42bb9;p=lhc%2Fweb%2Fwiklou.git Check validity of fetched titles and show a descriptive messages when an invalid title is encountered. Change-Id: I87471c4c5de5e66969b1ef8e4addc3a19c4c3b3d --- diff --git a/includes/specials/SpecialPopularpages.php b/includes/specials/SpecialPopularpages.php index 803f03e7f4..9f84804a05 100644 --- a/includes/specials/SpecialPopularpages.php +++ b/includes/specials/SpecialPopularpages.php @@ -56,7 +56,13 @@ class PopularPagesPage extends QueryPage { */ function formatResult( $skin, $result ) { global $wgContLang; - $title = Title::makeTitle( $result->namespace, $result->title ); + + $title = Title::makeTitleSafe( $result->namespace, $result->title ); + if( !$title ) { + return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ), + Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) ); + } + $link = Linker::linkKnown( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) )