From 6503849777aee51cb9d3f0d1b6e5b01512c54a41 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Tue, 18 Jun 2013 12:17:44 -0700 Subject: [PATCH] Use the latest revision's timestamp for basetimestamp Bug: 49390 Change-Id: Icacaa5101386e52309278c8d9871ca1193aa86a9 --- ApiVisualEditor.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php index ee484f1be4..8f2aab4855 100644 --- a/ApiVisualEditor.php +++ b/ApiVisualEditor.php @@ -20,7 +20,8 @@ class ApiVisualEditor extends ApiBase { $parserParams['oldid'] = ''; // Parsoid wants empty string rather than zero } $revision = Revision::newFromId( $parserParams['oldid'] ); - if ( $revision === null ) { + $latestRevision = Revision::newFromTitle( $title ); + if ( $revision === null || $latestRevision === null ) { return false; } $restoring = !$revision->isCurrent(); @@ -60,7 +61,7 @@ class ApiVisualEditor extends ApiBase { if ( $content === false ) { return false; } - $timestamp = $revision->getTimestamp(); + $timestamp = $latestRevision->getTimestamp(); } else { $content = ''; $timestamp = wfTimestampNow();