r44385 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44384‎ | r44385 | r44386 >
Date:05:33, 10 December 2008
Author:aaron
Status:ok
Tags:
Comment:
* Don't set ETag if $wgUseETag = false
* Avoid casting page ID as int twice
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/parser/ParserCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -686,7 +686,10 @@
687687
688688 # Try file cache
689689 if( $oldid === 0 && $this->checkTouched() ) {
690 - $wgOut->setETag( $parserCache->getETag($this,$wgUser) );
 690+ global $wgUseETag;
 691+ if( $wgUseETag ) {
 692+ $wgOut->setETag( $parserCache->getETag($this,$wgUser) );
 693+ }
691694 if( $wgOut->checkLastModified( $this->getTouched() ) ){
692695 wfProfileOut( __METHOD__ );
693696 return;
Index: trunk/phase3/includes/parser/ParserCache.php
@@ -35,9 +35,9 @@
3636 } else {
3737 $edit = '';
3838 }
39 - $pageid = intval( $article->getID() );
 39+ $pageid = $article->getID();
4040 $renderkey = (int)($action == 'render');
41 - $key = wfMemcKey( 'pcache', 'idhash', "$pageid-$renderkey!$hash$edit" );
 41+ $key = wfMemcKey( 'pcache', 'idhash', "{$pageid}-{$renderkey}!{$hash}{$edit}" );
4242 return $key;
4343 }
4444

Status & tagging log