]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
fix for special caracters in .mobi filenames
authorThomas Citharel <tcit@tcit.fr>
Mon, 26 Jan 2015 16:44:52 +0000 (17:44 +0100)
committerThomas Citharel <tcit@tcit.fr>
Mon, 26 Jan 2015 16:44:52 +0000 (17:44 +0100)
inc/poche/WallabagEBooks.class.php

index afcf4dbf530d0f0f9284ef7228282af9b054f0a9..558315719f336e50bc32b21a4a41bb5c137de328 100644 (file)
@@ -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');