Skip to content

Commit

Permalink
Fixed #53 to make sure pass is actually outputted
Browse files Browse the repository at this point in the history
By adding an explicit `echo` statement in the create function if `$output` is true.
  • Loading branch information
tschoffelen committed Jul 1, 2016
1 parent da012fd commit b212e53
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions PKPass.php
Expand Up @@ -256,19 +256,22 @@ public function create($output = false)
return false;
}

// Get contents of generated file
$file = file_get_contents($paths['pkpass']);
$this->clean();

// Output pass
if ($output == true) {

$fileName = ($this->getName()) ? $this->getName() : basename($paths['pkpass']);
header('Pragma: no-cache');
header('Content-type: application/vnd.apple.pkpass');
header('Content-length: ' . filesize($paths['pkpass']));
header('Content-Disposition: attachment; filename="' . $fileName . '"');

echo $file;
return true;
}

$file = file_get_contents($paths['pkpass']);
$this->clean();

return $file;
}

Expand Down

0 comments on commit b212e53

Please sign in to comment.