r105155 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105154‎ | r105155 | r105156 >
Date:07:33, 5 December 2011
Author:aaron
Status:deferred
Tags:
Comment:
Added additional file size check to hasFile()
Modified paths:
  • /branches/FileBackend/phase3/includes/media/MediaTransformOutput.php (modified) (history)

Diff [purge]

Index: branches/FileBackend/phase3/includes/media/MediaTransformOutput.php
@@ -71,13 +71,15 @@
7272
7373 /**
7474 * Check if an output thumbnail file was actually made.
75 - * This will return false if there was an error or the
76 - * thumnail is to be handled client-side only.
 75+ * This will return false if there was an error, the
 76+ * thumnail is to be handled client-side only, or if
 77+ * transformation was deferred via TRANSFORM_LATER.
7778 *
7879 * @return Bool
7980 */
8081 public function hasFile() {
81 - return ( !$this->isError() && $this->path );
 82+ // If TRANSFORM_LATER, a 0-byte temp file be at the path (not purged yet)
 83+ return ( !$this->isError() && $this->path && filesize( $this->path ) );
8284 }
8385
8486 /**

Status & tagging log