Django

Code

Ticket #2977: django-plus-sign-fix.patch

File django-plus-sign-fix.patch, 0.6 kB (added by andresj, 10 months ago)

Fix for problem with plus signs (see #4883) and dots (tried to fix also dollar signs and '' but didn't work--don't know why). Generated with svn diff.

  • django/core/urlresolvers.py

    old new  
    8686    """ 
    8787    # TODO: Handle nested parenthesis in the following regex. 
    8888    result = re.sub(r'\(([^)]+)\)', MatchChecker(args, kwargs), regex.pattern) 
    89     return result.replace('^', '').replace('$', '') 
     89    # TODO: Handle other special characters. 
     90    return result.replace('^', '').replace('$', '').replace('\+', '+').replace('\.', '.') 
    9091 
    9192class MatchChecker(object): 
    9293    "Class used in reverse RegexURLPattern lookup."