2
0
mirror of https://github.com/WikiTeam/wikiteam synced 2024-11-12 07:12:41 +00:00

Merge pull request #235 from PiRSquared17/truncate-file-utf8

Make filename truncation work with UTF-8
This commit is contained in:
nemobis 2015-03-28 21:55:56 +01:00
commit 213687011e

View File

@ -59,7 +59,7 @@ def getVersion():
def truncateFilename(other={}, filename=''):
""" Truncate filenames when downloading images with large filenames """
return filename[:other['filenamelimit']] + \
md5(filename).hexdigest() + '.' + filename.split('.')[-1]
md5(filename.encode('utf-8')).hexdigest() + '.' + filename.split('.')[-1]
def delay(config={}, session=None):