From 37df70c1ce92a3a997b211004299c31ee1585f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 30 Aug 2013 22:15:05 +0200 Subject: [PATCH] Fix url defined in css --HG-- extra : rebase_source : 4369c8c5b15840765e7f09d57e7c9173eb26a61f --- epubfs.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/epubfs.php b/epubfs.php index 6cc1678..d9dd6ef 100644 --- a/epubfs.php +++ b/epubfs.php @@ -42,14 +42,19 @@ try { $path = $matches [1]; $hash = "#" . $matches [2]; } + $end = ""; + if (preg_match ("/^src:/", $method)) { + $end = ")"; + } $comp = $book->getComponentName ($component, $path); if (!$comp) return "#"; - return "$method'epubfs.php?{$add}comp={$comp}{$hash}'"; + return "$method'epubfs.php?{$add}comp={$comp}{$hash}'{$end}"; }; $data = preg_replace_callback ("/(src=)[\"']([^:]*?)[\"']/", $callback, $data); $data = preg_replace_callback ("/(href=)[\"']([^:]*?)[\"']/", $callback, $data); $data = preg_replace_callback ("/(\@import\s+)[\"'](.*?)[\"'];/", $callback, $data); + $data = preg_replace_callback ("/(src:\s+url\()(.*?)\)/", $callback, $data); $expires = 60*60*24*14; header("Pragma: public");