From 545507773a69e5cfc94fcff566dfef03b83326e6 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Wed, 12 Jun 2024 10:54:32 +0200 Subject: [PATCH] fix cumulative effect --- epub.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/epub.php b/epub.php index e56b0b6..13eeec3 100644 --- a/epub.php +++ b/epub.php @@ -19,10 +19,17 @@ function write_epub($epub) { - if ( ! $epub->error ) { + if (file_exists($epub->epub_file)) + { + unlink($epub->epub_file); + } + + if (!$epub->error) + { $epub->CreateEPUB(); - if ( ! $epub->error ) { + if (!$epub->error) + { echo 'Success: ' . $epub->epub_file . ' created.
'; } else @@ -30,7 +37,9 @@ echo $epub->error; } - } else { + } + else + { echo $epub->error; } }