From 24ce6878738ed8fc5e124c21e1ebfb4895f670e5 Mon Sep 17 00:00:00 2001 From: Andy Irving Date: Sun, 2 Oct 2011 15:20:46 +0100 Subject: Don't relativize urls that lead with "//". Used to reference absolute ath in another domain, without hardcoding protocol (so it works with http or https, and your browser won't complain about unsecure content) Example: --- src/Hakyll/Web/Urls/Relativize.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hakyll/Web/Urls/Relativize.hs b/src/Hakyll/Web/Urls/Relativize.hs index f4b7a6c..0b7df4e 100644 --- a/src/Hakyll/Web/Urls/Relativize.hs +++ b/src/Hakyll/Web/Urls/Relativize.hs @@ -44,4 +44,4 @@ relativizeUrls :: String -- ^ Path to the site root -> String -- ^ Resulting HTML relativizeUrls root = withUrls rel where - rel x = if "/" `isPrefixOf` x then root ++ x else x + rel x = if "/" `isPrefixOf` x && not ("//" `isPrefixOf` x) then root ++ x else x -- cgit v1.2.3