diff options
Diffstat (limited to 'core/ReportRenderer.php')
-rw-r--r-- | core/ReportRenderer.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/core/ReportRenderer.php b/core/ReportRenderer.php index 9cf58448f7..0d634c4928 100644 --- a/core/ReportRenderer.php +++ b/core/ReportRenderer.php @@ -157,15 +157,11 @@ abstract class ReportRenderer extends BaseFactory $filename = self::appendExtension($filename, $extension); $outputFilename = self::getOutputPath($filename); - $emailReport = @fopen($outputFilename, "w"); - - if (!$emailReport) { - throw new Exception ("The file : " . $outputFilename . " can not be opened in write mode."); + $bytesWritten = file_put_contents($outputFilename, $content); + if ($bytesWritten === false) { + throw new Exception ("ReportRenderer: Could not write to file '" . $outputFilename . "'."); } - fwrite($emailReport, $content); - fclose($emailReport); - return $outputFilename; } |