From: Thomas Citharel Date: Mon, 26 Jan 2015 16:44:52 +0000 (+0100) Subject: fix for special caracters in .mobi filenames X-Git-Tag: 1.9beta~26 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=3829c54bc5ceff31cb72e686b3c020ea2ac2a5b2;p=github%2Fwallabag%2Fwallabag.git fix for special caracters in .mobi filenames --- 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');