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:
commit
213687011e
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user