Include parsed revision ID in parser cache
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 1 Apr 2014 14:52:24 +0000 (10:52 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 1 Apr 2014 16:15:34 +0000 (12:15 -0400)
commit78aad9802d467443996923f88ae7fd8c152572e0
treeb66884e51474df8f43cece25398a651fbab2286f
parentef846c6d3cf8e7213f431eb63a6592a8fa6f7812
Include parsed revision ID in parser cache

One theory for what's behind bug 46014 is that the vandal submits the
edit, then someone (maybe the vandal) gets into the branch of
Article::view that uses PoolWorkArticleView, then ClueBot comes along
and reverts before the PoolWorkArticleView actually executes. Once that
PoolWorkArticleView actually does execute, it overwrites the parser
cache entry from ClueBot's revert with the one from the old edit.

To detect this sort of thing, let's include the revision id in the
parser cache entry and consider it expired if that doesn't match. Which
makes sense to do anyway.

And for good measure, let's have PoolWorkArticleView not save to the
parser cache if !$isCurrent.

Bug: 46014
Change-Id: Ifcc4d2f67f3b77f990eb2fa45417a25bd6c7b790
includes/WikiPage.php
includes/jobqueue/jobs/RefreshLinksJob.php
includes/parser/CacheTime.php
includes/parser/ParserCache.php