From e6d18cfbe48adcf37d8284e8e49c42271ed00ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 30 Aug 2013 22:07:04 +0200 Subject: [PATCH] Seems to fix the case where the meta is not in the root of the epub --HG-- extra : rebase_source : 29d9f279a5ec3debcb67c5c11c82cd268fad4931 --- resources/php-epub-meta/epub.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/php-epub-meta/epub.php b/resources/php-epub-meta/epub.php index fa3147f..f30754a 100644 --- a/resources/php-epub-meta/epub.php +++ b/resources/php-epub-meta/epub.php @@ -171,6 +171,12 @@ class EPub { error_log ("Unable to find " . $path); return false; } + $ref = dirname('/'.$this->meta); + $ref = ltrim($ref,'\\'); + $ref = ltrim($ref,'/'); + if (strlen ($ref) > 0) { + $path = str_replace ($ref . "/", "", $path); + } return str_replace ("/", "-SLASH-", $path); }