X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryAllRevisions.php;h=3af24597c2220bced603bd3288c3d91d5d80040a;hb=b49456cf38b2d5f7d49b1f1d4ba68ded4833c762;hp=c8db6a1189bbc1b90441a03515b5164511772b04;hpb=fbb86f07d222ba6c31386472c5b792348b1c89e2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryAllRevisions.php b/includes/api/ApiQueryAllRevisions.php index c8db6a1189..3af24597c2 100644 --- a/includes/api/ApiQueryAllRevisions.php +++ b/includes/api/ApiQueryAllRevisions.php @@ -1,7 +1,5 @@ addWhereFld( 'rev_user', $id ); - } else { - $this->addWhereFld( 'rev_user_text', $params['user'] ); - } + $actorQuery = ActorMigration::newMigration() + ->getWhere( $db, 'rev_user', User::newFromName( $params['user'], false ) ); + $this->addTables( $actorQuery['tables'] ); + $this->addJoinConds( $actorQuery['joins'] ); + $this->addWhere( $actorQuery['conds'] ); } elseif ( $params['excludeuser'] !== null ) { - $id = User::idFromName( $params['excludeuser'] ); - if ( $id ) { - $this->addWhere( 'rev_user != ' . $id ); - } else { - $this->addWhere( 'rev_user_text != ' . $db->addQuotes( $params['excludeuser'] ) ); - } + $actorQuery = ActorMigration::newMigration() + ->getWhere( $db, 'rev_user', User::newFromName( $params['excludeuser'], false ) ); + $this->addTables( $actorQuery['tables'] ); + $this->addJoinConds( $actorQuery['joins'] ); + $this->addWhere( 'NOT(' . $actorQuery['conds'] . ')' ); } if ( $params['user'] !== null || $params['excludeuser'] !== null ) {