From: Aaron Schulz Date: Wed, 16 Sep 2015 22:13:48 +0000 (-0700) Subject: Fixed "last modified" date fudging on null edit X-Git-Tag: 1.31.0-rc.0~9946^2 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=35e4964e6c98e7cc09e42392abddfaffe02c1003;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ) );