aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2015-01-26 17:44:52 +0100
committerThomas Citharel <tcit@tcit.fr>2015-01-26 17:44:52 +0100
commit3829c54bc5ceff31cb72e686b3c020ea2ac2a5b2 (patch)
tree39dedc21fe2338ca7464d1574d94433ddd7c1cea
parent42ac69337f6538593e4375a38fb410b13c6cb660 (diff)
downloadwallabag-3829c54bc5ceff31cb72e686b3c020ea2ac2a5b2.tar.gz
wallabag-3829c54bc5ceff31cb72e686b3c020ea2ac2a5b2.tar.zst
wallabag-3829c54bc5ceff31cb72e686b3c020ea2ac2a5b2.zip
fix for special caracters in .mobi filenames
-rw-r--r--inc/poche/WallabagEBooks.class.php4
1 files 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
202 } 202 }
203 $mobi->setContentProvider($content); 203 $mobi->setContentProvider($content);
204 204
205 // we strip spaces because the browser inside Kindle Devices doesn't likes spaces 205 // the browser inside Kindle Devices doesn't likes special caracters either, we limit to A-z/0-9
206 $this->bookFileName = str_replace(' ', '_', $this->bookFileName); 206 $this->bookFileName = preg_replace('/[^A-Za-z0-9\-]/', '', $this->bookFileName);
207 207
208 // we offer file to download 208 // we offer file to download
209 $mobi->download($this->bookFileName.'.mobi'); 209 $mobi->download($this->bookFileName.'.mobi');