From 35e4964e6c98e7cc09e42392abddfaffe02c1003 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 16 Sep 2015 15:13:48 -0700 Subject: [PATCH] Fixed "last modified" date fudging on null edit * Avoid setting mTimestamp in doEditContent() until the edit was comitted. Null edits do not even try to add $revision to the DB, so do not set mTimestamp at all in that case. * This avoids the problem where ParserCache used a bad getTimestamp() value to set the ParserOutput timestamp via setTimestamp(), which Article later uses as the "last modified" timestamp. Bug: T112609 Change-Id: I79d7777c7f7470ff421ffeda80ac60dca07653fb --- includes/page/WikiPage.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 657c4d0f5c..b511d3240f 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1765,7 +1765,6 @@ class WikiPage implements Page, IDBAccessObject { $dbw = wfGetDB( DB_MASTER ); $now = wfTimestampNow(); - $this->mTimestamp = $now; if ( $flags & EDIT_UPDATE ) { // Update article, but only if changed. @@ -1844,6 +1843,7 @@ class WikiPage implements Page, IDBAccessObject { $user->incEditCount(); $dbw->commit( __METHOD__ ); + $this->mTimestamp = $now; } else { // Bug 32948: revision ID must be set to page {{REVISIONID}} and // related variables correctly @@ -1938,6 +1938,7 @@ class WikiPage implements Page, IDBAccessObject { $user->incEditCount(); $dbw->commit( __METHOD__ ); + $this->mTimestamp = $now; // Update links, etc. $this->doEditUpdates( $revision, $user, array( 'created' => true ) ); -- 2.20.1