#115 Prevent PDF being polluted with HTML at the EOF

This commit is contained in:
Mark Nelson 2017-05-31 16:08:42 +08:00
parent a943caf007
commit 1f219af560
2 changed files with 2 additions and 0 deletions

View file

@ -210,6 +210,7 @@ if ($data = $mform->get_data()) {
// Check if we want to preview this custom certificate.
if (!empty($data->previewbtn)) {
$template->generate_pdf(true);
exit();
}
// Redirect to the editing page to show form with recent updates.

View file

@ -137,4 +137,5 @@ if (empty($action)) {
// Now we want to generate the PDF.
$template = new \mod_customcert\template($template);
$template->generate_pdf();
exit();
}