From 78ef561f414d42b8dfb6519098a9cea828a5d071 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 21 Feb 2014 12:34:46 +0530 Subject: [PATCH] Fix in scrub_relative_urls --- frappe/website/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/website/utils.py b/frappe/website/utils.py index f780fa3f28..6c4199a33c 100644 --- a/frappe/website/utils.py +++ b/frappe/website/utils.py @@ -6,8 +6,8 @@ import frappe, re def scrub_relative_urls(html): """prepend a slash before a relative url""" - html = re.sub("""(src|href)[^\w'"]*['"](?!http|ftp|/|#)([^'" >]+)['"]""", '\g<1> = "/\g<2>"', html) - html = re.sub("""url\((?!http|ftp|/|#)([^\(\)]+)\)""", 'url(/\g<1>)', html) + html = re.sub("""(src|href)[^\w'"]*['"](?!http|ftp|/|#|%|{)([^'" >]+)['"]""", '\g<1> = "/\g<2>"', html) + html = re.sub("""url\((?!http|ftp|/|#|%|{)([^\(\)]+)\)""", 'url(/\g<1>)', html) return html def can_cache(no_cache=False):