Merge "shell.php: prevent permission error"
[lhc/web/wiklou.git] / includes / api / ApiQueryAllDeletedRevisions.php
index f885b72..87f99dd 100644 (file)
@@ -35,7 +35,7 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase {
        }
 
        /**
-        * @param ApiPageSet $resultPageSet
+        * @param ApiPageSet|null $resultPageSet
         * @return void
         */
        protected function run( ApiPageSet $resultPageSet = null ) {
@@ -136,16 +136,11 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase {
                }
 
                if ( $this->fetchContent ) {
-                       // Modern MediaWiki has the content for deleted revs in the 'text'
-                       // table using fields old_text and old_flags. But revisions deleted
-                       // pre-1.5 store the content in the 'archive' table directly using
-                       // fields ar_text and ar_flags, and no corresponding 'text' row. So
-                       // we have to LEFT JOIN and fetch all four fields.
                        $this->addTables( 'text' );
                        $this->addJoinConds(
                                [ 'text' => [ 'LEFT JOIN', [ 'ar_text_id=old_id' ] ] ]
                        );
-                       $this->addFields( [ 'ar_text', 'ar_flags', 'old_text', 'old_flags' ] );
+                       $this->addFields( [ 'old_text', 'old_flags' ] );
 
                        // This also means stricter restrictions
                        $this->checkUserRightsAny( [ 'deletedtext', 'undelete' ] );
@@ -154,11 +149,7 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase {
                $miser_ns = null;
 
                if ( $mode == 'all' ) {
-                       if ( $params['namespace'] !== null ) {
-                               $namespaces = $params['namespace'];
-                       } else {
-                               $namespaces = MWNamespace::getValidNamespaces();
-                       }
+                       $namespaces = $params['namespace'] ?? MWNamespace::getValidNamespaces();
                        $this->addWhereFld( 'ar_namespace', $namespaces );
 
                        // For from/to/prefix, we have to consider the potential