Browse Source

Fix in scrub_relative_urls

version-14
Anand Doshi 11 years ago
parent
commit
78ef561f41
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      frappe/website/utils.py

+ 2
- 2
frappe/website/utils.py View File

@@ -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):


Loading…
Cancel
Save