diff options
author | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2016-09-19 11:18:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-19 11:18:17 +0200 |
commit | f9feca5c64309a2a202258bb92ae24b7a1dbe31c (patch) | |
tree | 3c055535db881690e47541c2f8f04b6d2865c5ff /src/Wallabag | |
parent | a707643ef1a0d5f1cf4ab9826492f4c9cb2d8c09 (diff) | |
parent | 45d94a98f78320fd993c4d5bce925c66d8e38346 (diff) | |
download | wallabag-f9feca5c64309a2a202258bb92ae24b7a1dbe31c.tar.gz wallabag-f9feca5c64309a2a202258bb92ae24b7a1dbe31c.tar.zst wallabag-f9feca5c64309a2a202258bb92ae24b7a1dbe31c.zip |
Merge pull request #2297 from morhelluin/epub-export-special-chars
Fix issue #2296: epub export with special chars in the title.
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/EntriesExport.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 0cf835b4..e91007e1 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php | |||
@@ -163,8 +163,12 @@ class EntriesExport | |||
163 | $book->setSubject($tag['value']); | 163 | $book->setSubject($tag['value']); |
164 | } | 164 | } |
165 | 165 | ||
166 | // the reader in Kobo Devices doesn't likes special caracters | ||
167 | // in filenames, we limit to A-z/0-9 | ||
168 | $filename = preg_replace('/[^A-Za-z0-9\-]/', '', $entry->getTitle()); | ||
169 | |||
166 | $chapter = $content_start.$entry->getContent().$bookEnd; | 170 | $chapter = $content_start.$entry->getContent().$bookEnd; |
167 | $book->addChapter($entry->getTitle(), htmlspecialchars($entry->getTitle()).'.html', $chapter, true, EPub::EXTERNAL_REF_ADD); | 171 | $book->addChapter($entry->getTitle(), htmlspecialchars($filename).'.html', $chapter, true, EPub::EXTERNAL_REF_ADD); |
168 | } | 172 | } |
169 | 173 | ||
170 | return Response::create( | 174 | return Response::create( |