From: Kevin Decherf Date: Sun, 17 Mar 2019 22:36:10 +0000 (+0100) Subject: epub: fix exception when articles have the same title X-Git-Tag: 2.3.8~8^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=41d476d7e74b752e693a1b70e68b8cb05045653f;hp=a48ff25d4c9f99dfb8ec1a9a1ae296417af6d9c9;p=github%2Fwallabag%2Fwallabag.git epub: fix exception when articles have the same title This commit fixes an exception occuring when exporting as epub several articles with the same title. The chapter filename is now derived from title and url. Fixes #3642 Signed-off-by: Kevin Decherf --- diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index a2aa4d13..f981ee50 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -188,7 +188,7 @@ class EntriesExport foreach ($entry->getTags() as $tag) { $book->setSubject($tag->getLabel()); } - $filename = sha1($entry->getTitle()); + $filename = sha1(sprintf('%s:%s', $entry->getUrl(), $entry->getTitle())); $publishedBy = $entry->getPublishedBy(); $authors = $this->translator->trans('export.unknown');