Ticket #914: admin_modify.py.patch
File admin_modify.py.patch, 912 bytes (added by , 19 years ago) |
---|
-
admin_modify.py
16 16 return '_'.join([s.lower() for s in word_re.findall(name)[:-1]]) 17 17 18 18 def include_admin_script(script_path): 19 return '<script type="text/javascript" src="%s%s"></script>' % (ADMIN_MEDIA_PREFIX, script_path) 19 url_pattern = (r'''(?x)((http|https|ftp)://(\w+[:.]?){2,}(/?|[^ \n\r"']+[\w/!?.=#]) 20 (?=[\s\.,>)"'\]]))''') 21 if re.match(url_pattern, script_path) or script_path[0] == '/': 22 return '<script type="text/javascript" src="%s"></script>' % (script_path) 23 else: 24 return '<script type="text/javascript" src="%s%s"></script>' % (ADMIN_MEDIA_PREFIX, script_path) 20 25 include_admin_script = register.simple_tag(include_admin_script) 21 26 22 27 def submit_row(context, bound_manipulator):