diff options
author | Tim Starling <tstarling@wikimedia.org> | 2021-05-05 11:36:37 +1000 |
---|---|---|
committer | Tim Starling <tstarling@wikimedia.org> | 2021-05-06 11:38:30 +1000 |
commit | 7430e278c6b21d3cdcc608c3b8cb12ee3d4c04ef (patch) | |
tree | ca0585dd8bd4899d36de4baa886fc75f5db7bbde /includes | |
parent | ebd5b629b27871685dd535f0a3b02d89c4e5c647 (diff) | |
download | mediawikicore-7430e278c6b21d3cdcc608c3b8cb12ee3d4c04ef.tar.gz mediawikicore-7430e278c6b21d3cdcc608c3b8cb12ee3d4c04ef.zip |
EditPage::getExpectedParentRevision(): guard against null edittime
Document the fact that EditPage::$edittime can be null, and guard
against a type mismatch error in getExpectedParentRevision() which is
hit if EditPage::$edittime is null and EditPage::$editRevId is a value
that is false when converted to boolean.
Bug: T277204
Change-Id: Ibc9500a314ddfd99452d6c03d8906f69cdebc0e4
Diffstat (limited to 'includes')
-rw-r--r-- | includes/EditPage.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/EditPage.php b/includes/EditPage.php index 73dc4d8b3657..e9adf4dc831e 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -272,7 +272,7 @@ class EditPage implements IEditObject { */ private $nosummary = false; - /** @var string + /** @var string|null * Timestamp of the latest revision of the page when editing was initiated * on the client. */ @@ -2594,7 +2594,7 @@ class EditPage implements IEditObject { $this->editRevId, RevisionStore::READ_LATEST ); - } else { + } elseif ( $this->edittime ) { $revRecord = $this->revisionStore->getRevisionByTimestamp( $this->getTitle(), $this->edittime, |