Skip to content

Commit

Permalink
Merge pull request #117 from nullziu/temporary-file-url-cleanup-fix
Browse files Browse the repository at this point in the history
Fixing temporary file unlink when header or footer html is an URL.
  • Loading branch information
pilot committed Oct 14, 2014
2 parents b275c10 + 6e0fb7b commit e5d1e74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Knp/Snappy/Pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ public function generate($input, $output, array $options = array(), $overwrite =
parent::generate($input, $output, $options, $overwrite);

// to delete header or footer generated files
if (array_key_exists('header-html', $options)) {
if (array_key_exists('header-html', $options) && !filter_var($options['header-html'], FILTER_VALIDATE_URL)) {
$this->unlink($options['header-html']);
}

if (array_key_exists('footer-html', $options)) {
if (array_key_exists('footer-html', $options) && !filter_var($options['footer-html'], FILTER_VALIDATE_URL)) {
$this->unlink($options['footer-html']);
}
}
Expand Down

0 comments on commit e5d1e74

Please sign in to comment.