r45686 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45685‎ | r45686 | r45687 >
Date:20:46, 12 January 2009
Author:aaron
Status:deferred
Tags:
Comment:
Tweak dir and error handling
Modified paths:
  • /trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php
@@ -338,7 +338,7 @@
339339 // Set file path
340340 $dir = dirname($filePath);
341341 // Make sure directory exists
342 - if( !is_dir($dir) && !wfMkdirParents( $dir, 0777 ) ) {
 342+ if( !file_exists($dir) && !wfMkdirParents( $dir, 0777 ) ) {
343343 return false;
344344 }
345345 // Set some parameters
@@ -454,6 +454,7 @@
455455 $svgPath = $this->getFilePath( $tag, 'svg' );
456456 $svgHandler = new SvgHandler();
457457 if( !@file_put_contents( $svgPath, $plot->svg ) ) {
 458+ throw new MWException( 'Could not write SVG file!' );
458459 return false;
459460 }
460461 // Rasterize due to IE suckage

Status & tagging log