CategoryMembershipChange: Don't call Revision::getTimestamp
Check if a Revision object was passed before calling ::getTimestamp Bug: T254966 Change-Id: Ibd7330e9de5052b99ed7168d59a14c2990f2c185
This commit is contained in:
parent
f8cc519222
commit
3c811b5e3d
1 changed files with 6 additions and 7 deletions
|
|
@ -69,19 +69,18 @@ class CategoryMembershipChange {
|
|||
*/
|
||||
public function __construct( Title $pageTitle, $revision = null ) {
|
||||
$this->pageTitle = $pageTitle;
|
||||
if ( $revision === null ) {
|
||||
$this->timestamp = wfTimestampNow();
|
||||
} else {
|
||||
$this->timestamp = $revision->getTimestamp();
|
||||
}
|
||||
if ( $revision instanceof Revision ) {
|
||||
wfDeprecated(
|
||||
'Revision for ' . __METHOD__,
|
||||
'1.35'
|
||||
);
|
||||
$this->revision = $revision->getRevisionRecord();
|
||||
$revision = $revision->getRevisionRecord();
|
||||
}
|
||||
$this->revision = $revision;
|
||||
if ( $revision === null ) {
|
||||
$this->timestamp = wfTimestampNow();
|
||||
} else {
|
||||
$this->revision = $revision;
|
||||
$this->timestamp = $revision->getTimestamp();
|
||||
}
|
||||
$this->newForCategorizationCallback = [ RecentChange::class, 'newForCategorization' ];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue