From 115f405cdb5286399e2eb3f0da55427e23db7fe7 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Tue, 9 Oct 2007 19:15:35 +0000 Subject: [PATCH] Don't cache category pages if 'from' or 'until' is being used. --- RELEASE-NOTES | 2 ++ includes/CategoryPage.php | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f5fd42c8c6..5a51f4eaec 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -91,6 +91,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN some browsers. * (bug 11574) Add an interface message loginstart, which, similarly to loginend, appears just before the login form. Patch by MinuteElectron. +* Do not cache category pages if using 'from' or 'until' + === API changes in 1.12 === diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 76a388a6e0..656d3162fe 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -37,6 +37,19 @@ class CategoryPage extends Article { } } + /** + * This page should not be cached if 'from' or 'until' has been used + * @return bool + */ + function isFileCacheable() { + global $wgRequest; + + return ( ! Article::isFileCacheable() + || $wgRequest->getVal( 'from' ) + || $wgRequest->getVal( 'until' ) + ) ? false : true; + } + function openShowCategory() { # For overloading } @@ -410,7 +423,7 @@ class CategoryViewer { * @private */ function pagingLinks( $title, $first, $last, $limit, $query = array() ) { - global $wgUser, $wgLang; + global $wgLang; $sk = $this->getSkin(); $limitText = $wgLang->formatNum( $limit ); -- 2.20.1