From 3829c54bc5ceff31cb72e686b3c020ea2ac2a5b2 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 26 Jan 2015 17:44:52 +0100 Subject: [PATCH] fix for special caracters in .mobi filenames --- inc/poche/WallabagEBooks.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/poche/WallabagEBooks.class.php b/inc/poche/WallabagEBooks.class.php index afcf4dbf..55831571 100644 --- a/inc/poche/WallabagEBooks.class.php +++ b/inc/poche/WallabagEBooks.class.php @@ -202,8 +202,8 @@ class WallabagMobi extends WallabagEBooks } $mobi->setContentProvider($content); - // we strip spaces because the browser inside Kindle Devices doesn't likes spaces - $this->bookFileName = str_replace(' ', '_', $this->bookFileName); + // the browser inside Kindle Devices doesn't likes special caracters either, we limit to A-z/0-9 + $this->bookFileName = preg_replace('/[^A-Za-z0-9\-]/', '', $this->bookFileName); // we offer file to download $mobi->download($this->bookFileName.'.mobi'); -- 2.41.0