From 37e0410672ee435f85f1629c713fe9681418646d Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 10 Dec 2008 05:33:57 +0000 Subject: [PATCH] * Don't set ETag if $wgUseETag = false * Avoid casting page ID as int twice --- includes/Article.php | 5 ++++- includes/parser/ParserCache.php | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 8061efb95f..bc7cd963e5 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -686,7 +686,10 @@ class Article { # Try file cache if( $oldid === 0 && $this->checkTouched() ) { - $wgOut->setETag( $parserCache->getETag($this,$wgUser) ); + global $wgUseETag; + if( $wgUseETag ) { + $wgOut->setETag( $parserCache->getETag($this,$wgUser) ); + } if( $wgOut->checkLastModified( $this->getTouched() ) ){ wfProfileOut( __METHOD__ ); return; diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php index bf11da2eeb..7e61157a7d 100644 --- a/includes/parser/ParserCache.php +++ b/includes/parser/ParserCache.php @@ -35,9 +35,9 @@ class ParserCache { } else { $edit = ''; } - $pageid = intval( $article->getID() ); + $pageid = $article->getID(); $renderkey = (int)($action == 'render'); - $key = wfMemcKey( 'pcache', 'idhash', "$pageid-$renderkey!$hash$edit" ); + $key = wfMemcKey( 'pcache', 'idhash', "{$pageid}-{$renderkey}!{$hash}{$edit}" ); return $key; } -- 2.20.1