Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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