mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
Merge "Use the latest revision's timestamp for basetimestamp"
This commit is contained in:
commit
68c9dcc693
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue