From: Greg Sabino Mullane Date: Tue, 9 Oct 2007 19:15:35 +0000 (+0000) Subject: Don't cache category pages if 'from' or 'until' is being used. X-Git-Tag: 1.31.0-rc.0~51189 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=115f405cdb5286399e2eb3f0da55427e23db7fe7;p=lhc%2Fweb%2Fwiklou.git Don't cache category pages if 'from' or 'until' is being used. --- 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 );