From 72a857158c187206dae2eed08143d5743322cb0c Mon Sep 17 00:00:00 2001 From: tcit Date: Thu, 24 Apr 2014 03:08:31 +0200 Subject: [PATCH] Fixed a bug into PHPePub with special caracters --- inc/3rdparty/libraries/PHPePub/EPub.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/3rdparty/libraries/PHPePub/EPub.php b/inc/3rdparty/libraries/PHPePub/EPub.php index 836c0512..0260ce4f 100644 --- a/inc/3rdparty/libraries/PHPePub/EPub.php +++ b/inc/3rdparty/libraries/PHPePub/EPub.php @@ -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

" . str_repeat("      ", $level) . "" . $chapterName . "

\n"; + $tocData .= "\t

" . str_repeat("      ", $level) . "sanitizeFileName($fileName) . "\">" . $chapterName . "

\n"; } } else if ($this->tocAddReferences === TRUE) { if (array_key_exists($item, $this->ncx->referencesList)) { -- 2.41.0