diff --git a/pylons_app/lib/helpers.py b/pylons_app/lib/helpers.py --- a/pylons_app/lib/helpers.py +++ b/pylons_app/lib/helpers.py @@ -277,13 +277,17 @@ def pygmentize_annotation(filenode, **kw return literal(annotate_highlight(filenode, url_func, **kwargs)) def repo_name_slug(value): - """ - Return slug of name of repository + """Return slug of name of repository + This function is called on each creation/modification + of repository to prevent bad names in repo """ - slug = urlify(value) - for c in """=[]\;'"<>,/~!@#$%^&*()+{}|:""": + slug = remove_formatting(value) + slug = strip_tags(slug) + + for c in """=[]\;'"<>,/~!@#$%^&*()+{}|: """: slug = slug.replace(c, '-') slug = recursive_replace(slug, '-') + slug = collapse(slug, '-') return slug def get_changeset_safe(repo, rev): @@ -321,6 +325,7 @@ isodate = lambda x: util.datestr(x, '%Y isodatesec = lambda x: util.datestr(x, '%Y-%m-%d %H:%M:%S %1%2') localdate = lambda x: (x[0], util.makedate()[1]) rfc822date = lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S %1%2") +rfc822date_notz = lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S") rfc3339date = lambda x: util.datestr(x, "%Y-%m-%dT%H:%M:%S%1:%2") time_ago = lambda x: util.datestr(_age(x), "%a, %d %b %Y %H:%M:%S %1%2")