Skip to content

Commit

Permalink
Update munge.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mbellotti committed Aug 25, 2015
1 parent a5b8aa6 commit 752302b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ckan/lib/munge.py
Expand Up @@ -122,7 +122,7 @@ def munge_filename_legacy(filename):
'''
filename = substitute_ascii_equivalents(filename)
filename = filename.strip()
filename = re.sub(r'[^a-zA-Z0-9.\-_ ]', '', filename).replace(' ', '-')
filename = re.sub(r'[^a-zA-Z0-9.\- ]', '', filename).replace(' ', '-')
filename = _munge_to_length(filename, 3, 100)
return filename

Expand All @@ -139,7 +139,7 @@ def munge_filename(filename):
# clean up
filename = substitute_ascii_equivalents(filename)
filename = filename.lower().strip()
filename = re.sub(r'[^a-zA-Z0-9. -]', '', filename).replace(' ', '-')
filename = re.sub(r'[^a-zA-Z0-9. -_]', '', filename).replace(' ', '-')
# resize if needed but keep extension
name, ext = os.path.splitext(filename)
# limit overly long extensions
Expand Down

0 comments on commit 752302b

Please sign in to comment.