コード例 #1
0
 protected static function editCheckReview(Page $article, $rev, $user, $editTimestamp)
 {
     $prevTimestamp = null;
     $prevRevId = $rev->getParentId();
     // revision before $rev
     $title = $article->getTitle();
     // convenience
     # Check wpEdittime against the former current rev for verification
     if ($prevRevId) {
         $prevTimestamp = Revision::getTimestampFromId($title, $prevRevId);
     }
     # Was $rev is an edit to an existing page?
     if ($prevTimestamp) {
         # Check wpEdittime against the former current revision's time.
         # If an edit was auto-merged in between, then the new revision
         # has content different than what the user expected. However, if
         # the auto-merged edit was reviewed, then assume that it's OK.
         if ($editTimestamp != $prevTimestamp && !FlaggedRevision::revIsFlagged($prevRevId, FR_MASTER)) {
             return false;
             // not flagged?
         }
     }
     $flags = null;
     # Review this revision of the page...
     return FlaggedRevs::autoReviewEdit($article, $user, $rev, $flags, false);
 }