From: Aaron Schulz Date: Sun, 6 Jan 2008 03:17:09 +0000 (+0000) Subject: Revision timestamp comes out as the current time when no rev ID is given (like the... X-Git-Tag: 1.31.0-rc.0~50117 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=3ba2d84bd1a1f6a4ae1354943322a1545b8abe02;p=lhc%2Fweb%2Fwiklou.git Revision timestamp comes out as the current time when no rev ID is given (like the first time prepareTextForEdit() is called). This works for new revisions, but is wrong for null edits. Needs to be flagged so that editUpdates() knows to parse after rev ID given so that it can get the last timestamp. --- diff --git a/includes/Parser.php b/includes/Parser.php index a14cace280..6c0dc39984 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -2435,14 +2435,34 @@ class Parser wfDebug( __METHOD__ . ": {{REVISIONID}} used, setting vary-revision...\n" ); return $this->mRevisionId; case 'revisionday': + // Let the edit saving system know we should parse the page + // *after* a revision ID has been assigned. This is for null edits. + $this->mOutput->setFlag( 'vary-revision' ); + wfDebug( __METHOD__ . ": {{REVISIONDAY}} used, setting vary-revision...\n" ); return intval( substr( $this->getRevisionTimestamp(), 6, 2 ) ); case 'revisionday2': + // Let the edit saving system know we should parse the page + // *after* a revision ID has been assigned. This is for null edits. + $this->mOutput->setFlag( 'vary-revision' ); + wfDebug( __METHOD__ . ": {{REVISIONDAY2}} used, setting vary-revision...\n" ); return substr( $this->getRevisionTimestamp(), 6, 2 ); case 'revisionmonth': + // Let the edit saving system know we should parse the page + // *after* a revision ID has been assigned. This is for null edits. + $this->mOutput->setFlag( 'vary-revision' ); + wfDebug( __METHOD__ . ": {{REVISIONMONTH}} used, setting vary-revision...\n" ); return intval( substr( $this->getRevisionTimestamp(), 4, 2 ) ); case 'revisionyear': + // Let the edit saving system know we should parse the page + // *after* a revision ID has been assigned. This is for null edits. + $this->mOutput->setFlag( 'vary-revision' ); + wfDebug( __METHOD__ . ": {{REVISIONYEAR}} used, setting vary-revision...\n" ); return substr( $this->getRevisionTimestamp(), 0, 4 ); case 'revisiontimestamp': + // Let the edit saving system know we should parse the page + // *after* a revision ID has been assigned. This is for null edits. + $this->mOutput->setFlag( 'vary-revision' ); + wfDebug( __METHOD__ . ": {{REVISIONTIMESTAMP}} used, setting vary-revision...\n" ); return $this->getRevisionTimestamp(); case 'namespace': return str_replace('_',' ',$wgContLang->getNsText( $this->mTitle->getNamespace() ) );