resourceloader: Make action=purge affect ResourceLoaderWikiModule
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 2 Apr 2016 20:50:48 +0000 (21:50 +0100)
committerLegoktm <legoktm.wikipedia@gmail.com>
Sun, 3 Apr 2016 02:41:11 +0000 (02:41 +0000)
Purging a wiki page included in a WikiModule should bump its version hash.
This is not needed by design, but it's a workaround until our caching layers
are more resilient against cache poisoning.

This gives users the power to resolve issues themselves.

Change-Id: I37d3379e76a6b652268c5a007e0ad741470fe6e1

includes/resourceloader/ResourceLoaderWikiModule.php

index 7b0d93a..796dc20 100644 (file)
@@ -298,7 +298,8 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule {
 
                        if ( !$batch->isEmpty() ) {
                                $res = $dbr->select( [ 'page', 'revision' ],
-                                       [ 'page_namespace', 'page_title', 'rev_len', 'rev_sha1' ],
+                                       // Include page_touched to allow purging if cache is poisoned (T117587, T113916)
+                                       [ 'page_namespace', 'page_title', 'page_touched', 'rev_len', 'rev_sha1' ],
                                        $batch->constructSet( 'page', $dbr ),
                                        __METHOD__,
                                        [],
@@ -311,6 +312,7 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule {
                                        $this->titleInfo[$key][$title->getPrefixedText()] = [
                                                'rev_len' => $row->rev_len,
                                                'rev_sha1' => $row->rev_sha1,
+                                               'page_touched' => $row->page_touched,
                                        ];
                                }
                        }