Edgewall Software

Ticket #7768: allow_absolute_urls_for_add_script_add_stylesheet.patch

File allow_absolute_urls_for_add_script_add_stylesheet.patch, 1.1 KB (added by mark.m.mcmahon@…, 21 months ago)

Adds a check for the filename starting with http

  • chrome.py

     
    8484    will be based off the application root path. If it is relative, the link 
    8585    will be based off the `/chrome/` path. 
    8686    """ 
    87     if filename.startswith('common/') and 'htdocs_location' in req.chrome: 
     87    if filename.startswith('http'): 
     88        # don't process aboslute urls 
     89        pass 
     90    elif filename.startswith('common/') and 'htdocs_location' in req.chrome: 
    8891        href = Href(req.chrome['htdocs_location']) 
    8992        filename = filename[7:] 
    9093    else: 
     
    104107    if filename in scriptset: 
    105108        return False # Already added that script 
    106109 
    107     if filename.startswith('common/') and 'htdocs_location' in req.chrome: 
     110    if filename.startswith('http'): 
     111        # don't process aboslute urls 
     112        pass 
     113    elif filename.startswith('common/') and 'htdocs_location' in req.chrome: 
    108114        href = Href(req.chrome['htdocs_location']) 
    109115        path = filename[7:] 
    110116    else: