From 1daf83fb2c94e7d55ee02b4ccfb0f63abecb3764 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 31 May 2017 16:08:42 +0800 Subject: [PATCH] #115 Prevent PDF being polluted with HTML at the EOF --- edit.php | 1 + view.php | 1 + 2 files changed, 2 insertions(+) diff --git a/edit.php b/edit.php index 1293162..9061157 100644 --- a/edit.php +++ b/edit.php @@ -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. diff --git a/view.php b/view.php index 4e6014c..64653e2 100644 --- a/view.php +++ b/view.php @@ -137,4 +137,5 @@ if (empty($action)) { // Now we want to generate the PDF. $template = new \mod_customcert\template($template); $template->generate_pdf(); + exit(); }