]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Fixed a bug into PHPePub with special caracters
authortcit <tcit@tcit.fr>
Thu, 24 Apr 2014 01:08:31 +0000 (03:08 +0200)
committertcit <tcit@tcit.fr>
Thu, 24 Apr 2014 01:08:31 +0000 (03:08 +0200)
inc/3rdparty/libraries/PHPePub/EPub.php

index 836c05121a39cc7e101dd42b3028da4b5c165943..0260ce4f2adcfb7f2c145db70a80698422105271 100644 (file)
@@ -343,6 +343,7 @@ class EPub {
         }
         $fileName = Zip::getRelativePath($fileName);
         $fileName = preg_replace('#^[/\.]+#i', "", $fileName);
+        $fileName = $this->sanitizeFileName($fileName);
 
         $chapter = $chapterData;
         if ($autoSplit && is_string($chapterData) && mb_strlen($chapterData) > $this->splitDefaultSize) {
@@ -1699,7 +1700,7 @@ class EPub {
                 while (list($chapterName, $navPoint) = each($this->ncx->chapterList)) {
                                        $fileName = $navPoint->getContentSrc();
                                        $level = $navPoint->getLevel() -2;
-                                       $tocData .= "\t<p>" . str_repeat(" &#160;  &#160;  &#160;", $level) . "<a href=\"" . $fileName . "\">" . $chapterName . "</a></p>\n";
+                                       $tocData .= "\t<p>" . str_repeat(" &#160;  &#160;  &#160;", $level) . "<a href=\"" . $this->sanitizeFileName($fileName) . "\">" . $chapterName . "</a></p>\n";
                 }
             } else if ($this->tocAddReferences === TRUE) {
                 if (array_key_exists($item, $this->ncx->referencesList)) {