Example #1
0
def clean_next(next):
    if next is None:
        return DEFAULT_NEXT
    next = str_to_unicode(urllib.unquote(next), 'utf-8')
    next = next.strip()
    if next.startswith('/'):
        return next
    return DEFAULT_NEXT
Example #2
0
def clean_next(next):
    if next is None:
        return DEFAULT_NEXT
    next = str_to_unicode(urllib.unquote(next), 'utf-8')
    next = next.strip()
    if next.startswith('/'):
        return next
    return DEFAULT_NEXT
Example #3
0
def clean_next(next, default = None):
    if next is None or not next.startswith('/'):
        if default:
            return default
        else:
            return DEFAULT_NEXT
    next = str_to_unicode(urllib.unquote(next), 'utf-8')
    next = next.strip()
    logging.debug('next url is %s' % next)
    return next
Example #4
0
def clean_next(next):
    if next is None:
        return DEFAULT_NEXT
    next = str_to_unicode(urllib.unquote(next), 'utf-8')
    next = next.strip()
    if next.startswith('/'):
        logging.debug('next url is %s' % next)
        return next
    logging.debug('next url is %s' % DEFAULT_NEXT)
    return DEFAULT_NEXT
Example #5
0
def clean_next(next):
    if next is None:
        return DEFAULT_NEXT
    next = str_to_unicode(urllib.unquote(next), 'utf-8')
    next = next.strip()
    if next.startswith('/'):
        logging.debug('next url is %s' % next)
        return next
    logging.debug('next url is %s' % DEFAULT_NEXT)
    return DEFAULT_NEXT
Example #6
0
def clean_next(next, default=None):
    if next is None or not next.startswith('/'):
        if default:
            return default
        else:
            return DEFAULT_NEXT
    next = str_to_unicode(urllib.unquote(next), 'utf-8')
    next = next.strip()
    logging.debug('next url is %s' % next)
    return next
Example #7
0
def clean_next(next):
    """
    Do necessary init and clean to the 'next' variable.

    (Credits to django_authopenid.util)
    """
    if next is None:
        return DEFAULT_NEXT
    next = str_to_unicode(unquote(next), 'utf-8')
    next = next.strip()
    if next.startswith('/'):
        return next
    return DEFAULT_NEXT
Example #8
0
def clean_next(next):
    """
    Do necessary init and clean to the 'next' variable.

    (Credits to django_authopenid.util)
    """
    if next is None:
        return DEFAULT_NEXT
    next = str_to_unicode(unquote(next), 'utf-8')
    next = next.strip()
    if next.startswith('/'):
        return next
    return DEFAULT_NEXT
 def clean(self, value):
     if value is None:
         return self.default_next_url
     value = str_to_unicode(urllib.unquote(value), 'utf-8').strip()
     assert(value.startswith('/'))
     return value