From af4d194c7beb4020c7aff5f8c9eb36156b9b407e Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 14 Nov 2018 23:57:41 +0000 Subject: [PATCH] Improved new import so that it does not flood the output with multiple XML errors. --- WEB-INF/lib/ttOrgImportHelper.class.php | 4 ++-- WEB-INF/templates/footer.tpl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WEB-INF/lib/ttOrgImportHelper.class.php b/WEB-INF/lib/ttOrgImportHelper.class.php index 77458cfa..96ac5708 100644 --- a/WEB-INF/lib/ttOrgImportHelper.class.php +++ b/WEB-INF/lib/ttOrgImportHelper.class.php @@ -525,7 +525,7 @@ class ttOrgImportHelper { // Read and parse the content of the file. During parsing, startElement is called back for each tag. $file = fopen($filename, 'r'); - while ($data = fread($file, 4096)) { + while (($data = fread($file, 4096)) && $this->errors->no()) { if (!xml_parse($parser, $data, feof($file))) { $this->errors->add(sprintf($i18n->get('error.xml'), xml_get_current_line_number($parser), @@ -554,7 +554,7 @@ class ttOrgImportHelper { // Read and parse the content of the file. During parsing, startElement is called back for each tag. $file = fopen($filename, 'r'); - while ($data = fread($file, 4096)) { + while (($data = fread($file, 4096)) && $this->errors->no()) { if (!xml_parse($parser, $data, feof($file))) { $this->errors->add(sprintf($i18n->get('error.xml'), xml_get_current_line_number($parser), diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 16196a60..1f8ef090 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.12.4424 | Copyright © Anuko | +  Anuko Time Tracker 1.18.12.4425 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1