From 8a678a620f0713770d278e6eae021229df26b589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Mon, 13 Jan 2014 21:43:44 +0100 Subject: [PATCH] Fix hash handling --- epubfs.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/epubfs.php b/epubfs.php index c86c571..76c71bd 100644 --- a/epubfs.php +++ b/epubfs.php @@ -34,18 +34,18 @@ try { $callback = function ($m) use ($book, $component, $add) { $method = $m[1]; $path = $m[2]; + $end = ""; + if (preg_match ("/^src:/", $method)) { + $end = ")"; + } if (preg_match ("/^#/", $path)) { - return $path; + return "{$method}'{$path}'{$end}"; } $hash = ""; if (preg_match ("/^(.+)#(.+)$/", $path, $matches)) { $path = $matches [1]; $hash = "#" . $matches [2]; } - $end = ""; - if (preg_match ("/^src:/", $method)) { - $end = ")"; - } $comp = $book->getComponentName ($component, $path); if (!$comp) return "#"; return str_replace ("&", "&", "{$method}'epubfs.php?{$add}comp={$comp}{$hash}'{$end}");