* Don't set ETag if $wgUseETag = false
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 10 Dec 2008 05:33:57 +0000 (05:33 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 10 Dec 2008 05:33:57 +0000 (05:33 +0000)
* Avoid casting page ID as int twice

includes/Article.php
includes/parser/ParserCache.php

index 8061efb..bc7cd96 100644 (file)
@@ -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;
index bf11da2..7e61157 100644 (file)
@@ -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;
        }