Merge "Exclude redirects from Special:Fewestrevisions"
[lhc/web/wiklou.git] / includes / api / ApiQueryDeletedRevisions.php
index 9275a7c..bbb987f 100644 (file)
@@ -83,7 +83,7 @@ class ApiQueryDeletedRevisions extends ApiQueryRevisionsBase {
                if ( !is_null( $params['tag'] ) ) {
                        $this->addTables( 'change_tag' );
                        $this->addJoinConds(
-                               [ 'change_tag' => [ 'INNER JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ]
+                               [ 'change_tag' => [ 'JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ]
                        );
                        $changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
                        try {
@@ -94,14 +94,8 @@ class ApiQueryDeletedRevisions extends ApiQueryRevisionsBase {
                        }
                }
 
+               // This means stricter restrictions
                if ( $this->fetchContent ) {
-                       $this->addTables( 'text' );
-                       $this->addJoinConds(
-                               [ 'text' => [ 'LEFT JOIN', [ 'ar_text_id=old_id' ] ] ]
-                       );
-                       $this->addFields( [ 'old_text', 'old_flags' ] );
-
-                       // This also means stricter restrictions
                        $this->checkUserRightsAny( [ 'deletedtext', 'undelete' ] );
                }
 
@@ -155,7 +149,7 @@ class ApiQueryDeletedRevisions extends ApiQueryRevisionsBase {
                        $op = ( $dir == 'newer' ? '>' : '<' );
                        if ( $revCount !== 0 ) {
                                $this->dieContinueUsageIf( count( $cont ) != 2 );
-                               $rev = intval( $cont[0] );
+                               $rev = (int)$cont[0];
                                $this->dieContinueUsageIf( strval( $rev ) !== $cont[0] );
                                $ar_id = (int)$cont[1];
                                $this->dieContinueUsageIf( strval( $ar_id ) !== $cont[1] );
@@ -164,7 +158,7 @@ class ApiQueryDeletedRevisions extends ApiQueryRevisionsBase {
                                        "ar_id $op= $ar_id)" );
                        } else {
                                $this->dieContinueUsageIf( count( $cont ) != 4 );
-                               $ns = intval( $cont[0] );
+                               $ns = (int)$cont[0];
                                $this->dieContinueUsageIf( strval( $ns ) !== $cont[0] );
                                $title = $db->addQuotes( $cont[1] );
                                $ts = $db->addQuotes( $db->timestamp( $cont[2] ) );