X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FRevision.php;h=90d6265823e9ebd6d01a61c9f3c9879fa5815a8f;hb=4c4325e98cc7e8b7c4321e36fa03975ed8ec4265;hp=658420702a8b3ad2035bcc24cadaf9dc0feb1858;hpb=254b163a9605c5f2e92c7b76158a8e8166efbbce;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Revision.php b/includes/Revision.php index 658420702a..90d6265823 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -948,18 +948,25 @@ class Revision implements IDBAccessObject { /** * Get the RC object belonging to the current revision, if there's one * + * @param int $flags (optional) $flags include: + * Revision::READ_LATEST : Select the data from the master + * * @since 1.22 * @return RecentChange|null */ - public function getRecentChange() { + public function getRecentChange( $flags = 0 ) { $dbr = wfGetDB( DB_SLAVE ); + + list( $dbType, ) = DBAccessObjectUtils::getDBOptions( $flags ); + return RecentChange::newFromConds( array( 'rc_user_text' => $this->getUserText( Revision::RAW ), 'rc_timestamp' => $dbr->timestamp( $this->getTimestamp() ), 'rc_this_oldid' => $this->getId() ), - __METHOD__ + __METHOD__, + $dbType ); }