X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiQueryRecentChanges.php;h=517cf1f8608f050eaed76637d53f0f072d5af032;hp=9af4e3e4a2633ee7b4cf19e528f98a48ab5eea16;hb=689c847a32e7fe8a0b3a559a88a627a252c5018e;hpb=11cf01dd9a8512ad4d9bded43cf22ebd38af8818 diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 9af4e3e4a2..517cf1f860 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -1,9 +1,5 @@ @gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -65,7 +61,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { } $this->tokenFunctions = [ - 'patrol' => [ 'ApiQueryRecentChanges', 'getPatrolToken' ] + 'patrol' => [ self::class, 'getPatrolToken' ] ]; Hooks::run( 'APIQueryRecentChangesTokens', [ &$this->tokenFunctions ] ); @@ -287,14 +283,6 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { ); $showRedirects = $this->fld_redirect || isset( $show['redirect'] ) || isset( $show['!redirect'] ); - - if ( $this->fld_comment || $this->fld_parsedcomment ) { - $this->commentStore = new CommentStore( 'rc_comment' ); - $commentQuery = $this->commentStore->getJoin(); - $this->addTables( $commentQuery['tables'] ); - $this->addFields( $commentQuery['fields'] ); - $this->addJoinConds( $commentQuery['joins'] ); - } } $this->addFieldsIf( [ 'rc_this_oldid' ], $resultPageSet && $params['generaterevisions'] ); @@ -360,6 +348,15 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { } $this->token = $params['token']; + + if ( $this->fld_comment || $this->fld_parsedcomment || $this->token ) { + $this->commentStore = new CommentStore( 'rc_comment' ); + $commentQuery = $this->commentStore->getJoin(); + $this->addTables( $commentQuery['tables'] ); + $this->addFields( $commentQuery['fields'] ); + $this->addJoinConds( $commentQuery['joins'] ); + } + $this->addOption( 'LIMIT', $params['limit'] + 1 ); $hookData = [];