X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiSetNotificationTimestamp.php;h=3f6f14c1b3e04df5379b2e5b45b0ad6a89e49164;hb=9283760f340c6971d748fb574a35453fa7928807;hp=ba4c6e832170ff94cb260d0e70ea3b154ea92784;hpb=f5e45bb6d75d6df49fc2285877487ad74d095bf1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiSetNotificationTimestamp.php b/includes/api/ApiSetNotificationTimestamp.php index ba4c6e8321..3f6f14c1b3 100644 --- a/includes/api/ApiSetNotificationTimestamp.php +++ b/includes/api/ApiSetNotificationTimestamp.php @@ -77,8 +77,9 @@ class ApiSetNotificationTimestamp extends ApiBase { $titles = $pageSet->getGoodTitles(); $title = reset( $titles ); if ( $title ) { + // XXX $title isn't actually used, can we just get rid of the previous six lines? $timestamp = MediaWikiServices::getInstance()->getRevisionStore() - ->getTimestampFromId( $title, $params['torevid'], IDBAccessObject::READ_LATEST ); + ->getTimestampFromId( $params['torevid'], IDBAccessObject::READ_LATEST ); if ( $timestamp ) { $timestamp = $dbw->timestamp( $timestamp ); } else { @@ -92,13 +93,14 @@ class ApiSetNotificationTimestamp extends ApiBase { $titles = $pageSet->getGoodTitles(); $title = reset( $titles ); if ( $title ) { - $revid = $title->getNextRevisionID( $params['newerthanrevid'], Title::GAID_FOR_UPDATE ); - if ( $revid ) { - $timestamp = $dbw->timestamp( - MediaWikiServices::getInstance()->getRevisionStore()->getTimestampFromId( $title, $revid ) - ); - } else { - $timestamp = null; + $timestamp = null; + $rl = MediaWikiServices::getInstance()->getRevisionLookup(); + $currRev = $rl->getRevisionById( $params['newerthanrevid'], Title::READ_LATEST ); + if ( $currRev ) { + $nextRev = $rl->getNextRevision( $currRev, Title::READ_LATEST ); + if ( $nextRev ) { + $timestamp = $dbw->timestamp( $nextRev->getTimestamp() ); + } } } }