Merge "ApiBase: Always validate that 'limit' is numeric"
[lhc/web/wiklou.git] / includes / api / ApiPageSet.php
index 6b24b63..6afb018 100644 (file)
@@ -77,6 +77,7 @@ class ApiPageSet extends ApiBase {
        private $mGeneratorData = []; // [ns][dbkey] => data array
        private $mFakePageId = -1;
        private $mCacheMode = 'public';
+       /** @var array */
        private $mRequestedPageFields = [];
        /** @var int */
        private $mDefaultNamespace = NS_MAIN;
@@ -971,7 +972,8 @@ class ApiPageSet extends ApiBase {
                // If the user can see deleted revisions, pull out the corresponding
                // titles from the archive table and include them too. We ignore
                // ar_page_id because deleted revisions are tied by title, not page_id.
-               if ( $goodRemaining && $this->getUser()->isAllowed( 'deletedhistory' ) ) {
+               if ( $goodRemaining &&
+                        $this->getPermissionManager()->userHasRight( $this->getUser(), 'deletedhistory' ) ) {
                        $tables = [ 'archive' ];
                        $fields = [ 'ar_rev_id', 'ar_namespace', 'ar_title' ];
                        $where = [ 'ar_rev_id' => array_keys( $goodRemaining ) ];
@@ -1252,7 +1254,7 @@ class ApiPageSet extends ApiBase {
 
                        // Need gender information
                        if (
-                               MediaWikiServices::getInstance()->getNamespaceInfo()->
+                               $services->getNamespaceInfo()->
                                        hasGenderDistinction( $titleObj->getNamespace() )
                        ) {
                                $usernames[] = $titleObj->getText();