From 9d37187e4333bd83c3dd0901f1dc986c3903fc49 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sun, 28 Apr 2024 09:50:29 +0200 Subject: [PATCH] check if date of file can be parsed --- utils/xmlimport.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/xmlimport.php b/utils/xmlimport.php index 3b2943dd1..cecd7c3e0 100644 --- a/utils/xmlimport.php +++ b/utils/xmlimport.php @@ -811,7 +811,11 @@ function insert_document($document) { /* {{{ */ $file['attributes']['version'], $file['attributes']['public'] ); - $newfile->setDate(dateToTimestamp($file['attributes']['date'])); + $d = dateToTimestamp($file['attributes']['date']); + if($d) + $newfile->setDate($d); + else + $logger->warning("File date (".$file['attributes']['date'].") could not be parsed."); unlink($filename); } }