Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue #100 - Snapshot always return success message [fix]

  • Loading branch information...
commit 1a8fd4cfd99c8abecdebdce835526714122defae 1 parent 1744548
@ma-si ma-si authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 app/controller/Home.php
View
7 app/controller/Home.php
@@ -5,14 +5,13 @@
class Home extends \app\core\Controller {
protected function _create_snapshot($view_data) {
- $filename = realpath(
- \app\lib\Library::retrieve('snapshot_directory')
- ) . '/' . date('Y-m-d_H-i') . '.html';
+ $directory = \app\lib\Library::retrieve('snapshot_directory');
+ $filename = realpath($directory). '/' . date('Y-m-d_H-i') . '.html';
$contents = $this->render_html('partial/test_results', $view_data);
$handle = @fopen($filename, 'a');
- if ( !$handle ) {
+ if ( !file_exists($directory) || !$handle ) {
return array(
'type' => 'failed',
'title' => 'Error Creating Snapshot',
Please sign in to comment.
Something went wrong with that request. Please try again.