Merge "Remove parameter 'options' from hook 'SkinEditSectionLinks'"
[lhc/web/wiklou.git] / includes / specials / SpecialAncientpages.php
index ff44bda..a32393e 100644 (file)
@@ -43,18 +43,32 @@ class AncientPagesPage extends QueryPage {
        }
 
        public function getQueryInfo() {
+               $tables = [ 'page', 'revision' ];
+               $conds = [
+                       'page_namespace' =>
+                               MediaWikiServices::getInstance()->getNamespaceInfo()->getContentNamespaces(),
+                       'page_is_redirect' => 0
+               ];
+               $joinConds = [
+                       'revision' => [
+                               'JOIN', [
+                                       'page_latest = rev_id'
+                               ]
+                       ],
+               ];
+
+               // Allow extensions to modify the query
+               Hooks::run( 'AncientPagesQuery', [ &$tables, &$conds, &$joinConds ] );
+
                return [
-                       'tables' => [ 'page', 'revision' ],
+                       'tables' => $tables,
                        'fields' => [
                                'namespace' => 'page_namespace',
                                'title' => 'page_title',
                                'value' => 'rev_timestamp'
                        ],
-                       'conds' => [
-                               'page_namespace' => MWNamespace::getContentNamespaces(),
-                               'page_is_redirect' => 0,
-                               'page_latest=rev_id'
-                       ]
+                       'conds' => $conds,
+                       'join_conds' => $joinConds
                ];
        }
 
@@ -81,8 +95,8 @@ class AncientPagesPage extends QueryPage {
                $linkRenderer = $this->getLinkRenderer();
                $link = $linkRenderer->makeKnownLink(
                        $title,
-                       MediaWikiServices::getInstance()->getContentLanguage()->
-                               convert( $title->getPrefixedText() )
+                       new HtmlArmor( MediaWikiServices::getInstance()->getContentLanguage()->
+                               convert( htmlspecialchars( $title->getPrefixedText() ) ) )
                );
 
                return $this->getLanguage()->specialList( $link, htmlspecialchars( $d ) );