From: Aaron Schulz Date: Mon, 17 Aug 2009 01:54:31 +0000 (+0000) Subject: Fixed html filecache handling of ?curid urls X-Git-Tag: 1.31.0-rc.0~40268 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=7ead47486d16a9432337f494d97a64e636f7c894;p=lhc%2Fweb%2Fwiklou.git Fixed html filecache handling of ?curid urls --- diff --git a/index.php b/index.php index 4997f73af5..edf28d30db 100644 --- a/index.php +++ b/index.php @@ -80,20 +80,26 @@ if( $wgUseFileCache && isset( $wgTitle ) ) { // Raw pages should handle cache control on their own, // even when using file cache. This reduces hits from clients. if( $action != 'raw' && HTMLFileCache::useFileCache() ) { - /* Try low-level file cache hit */ - $cache = new HTMLFileCache( $wgTitle, $action ); - if( $cache->isFileCacheGood( /* Assume up to date */ ) ) { - /* Check incoming headers to see if client has this cached */ - if( !$wgOut->checkLastModified( $cache->fileCacheTime() ) ) { - $cache->loadFromFileCache(); + /* Set the title from the page ID if needed... */ + if( $curid = $wgRequest->getInt('curid') ) { + $wgTitle = Title::newFromID( $curid ); + } + if( !is_null($wgTitle) ) { + /* Try low-level file cache hit */ + $cache = new HTMLFileCache( $wgTitle, $action ); + if( $cache->isFileCacheGood( /* Assume up to date */ ) ) { + /* Check incoming headers to see if client has this cached */ + if( !$wgOut->checkLastModified( $cache->fileCacheTime() ) ) { + $cache->loadFromFileCache(); + } + # Do any stats increment/watchlist stuff + $wgArticle = MediaWiki::articleFromTitle( $wgTitle ); + $wgArticle->viewUpdates(); + # Tell $wgOut that output is taken care of + wfProfileOut( 'main-try-filecache' ); + $mediaWiki->restInPeace(); + exit; } - # Do any stats increment/watchlist stuff - $wgArticle = MediaWiki::articleFromTitle( $wgTitle ); - $wgArticle->viewUpdates(); - # Tell $wgOut that output is taken care of - wfProfileOut( 'main-try-filecache' ); - $mediaWiki->restInPeace(); - exit; } } wfProfileOut( 'main-try-filecache' );