From a42e24cba3c451fe2b20e1902d3e0ce35ca50bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 30 Aug 2013 21:14:59 +0200 Subject: [PATCH] Handle hashtags --HG-- extra : rebase_source : 6f3b4f27a7e7243da9b078de5f89c137b21d8fbd --- epubfs.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/epubfs.php b/epubfs.php index b8c8bb6..6cc1678 100644 --- a/epubfs.php +++ b/epubfs.php @@ -37,9 +37,14 @@ try { if (preg_match ("/^#/", $path)) { return $path; } + $hash = ""; + if (preg_match ("/^(.+)#(.+)$/", $path, $matches)) { + $path = $matches [1]; + $hash = "#" . $matches [2]; + } $comp = $book->getComponentName ($component, $path); if (!$comp) return "#"; - return "$method'epubfs.php?{$add}comp=$comp'"; + return "$method'epubfs.php?{$add}comp={$comp}{$hash}'"; }; $data = preg_replace_callback ("/(src=)[\"']([^:]*?)[\"']/", $callback, $data);