r47375 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47374‎ | r47375 | r47376 >
Date:19:08, 17 February 2009
Author:brion
Status:ok
Tags:
Comment:
Follow-up to r47361: code style cleanup (consolidate a couple of duplicated checks, unneeded variable copying)
Modified paths:
  • /trunk/phase3/includes/HTMLFileCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HTMLFileCache.php
@@ -159,16 +159,12 @@
160160 wfMkdirParents( $mydir2 );
161161 }
162162
163 - public function saveToFileCache( $origtext ) {
 163+ public function saveToFileCache( $text ) {
164164 global $wgUseFileCache;
165 - if( !$wgUseFileCache ) {
166 - return $origtext; // return to output
 165+ if( !$wgUseFileCache || strlen( $text ) < 512 ) {
 166+ // Disabled or empty/broken output (OOM and PHP errors)
 167+ return $text;
167168 }
168 - $text = $origtext;
169 - // Empty?
170 - if( strcmp($text,'') == 0 ) return '';
171 - // Probably broken? (OOM and PHP errors)
172 - if( mb_strlen($text) < 512 ) return $origtext;
173169
174170 wfDebug(" saveToFileCache()\n", false);
175171

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r47361Try to avoid file caching php fatals, it's very annoyingaaron15:05, 17 February 2009

Status & tagging log