]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
epub: fix exception when articles have the same title 3908/head
authorKevin Decherf <kevin@kdecherf.com>
Sun, 17 Mar 2019 22:36:10 +0000 (23:36 +0100)
committerKevin Decherf <kevin@kdecherf.com>
Sun, 17 Mar 2019 22:36:10 +0000 (23:36 +0100)
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 <kevin@kdecherf.com>
src/Wallabag/CoreBundle/Helper/EntriesExport.php

index a2aa4d134e4aebe60abcbfce631d1cadc40c18cf..f981ee50e61b8a323ae091f97f1139b82896de17 100644 (file)
@@ -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');