Disable remove_control_characters under path_badchars indefinitely.

master
voussoir 2021-01-28 17:00:19 -08:00
parent c4ea7c31ac
commit c40deb3631
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
2 changed files with 5 additions and 2 deletions

View File

@ -407,7 +407,11 @@ def remove_path_badchars(filepath, allowed=''):
'''
badchars = stringtools.remove_characters(constants.FILENAME_BADCHARS, allowed)
filepath = stringtools.remove_characters(filepath, badchars)
filepath = stringtools.remove_control_characters(filepath)
# Note: This is temporarily disabled until I can improve
# remove_control_characters. I want to avoid abusive / totally bogus names
# without breaking legitimate uses of control characters such as
# left-to-right marks which may appear in e.g. Arabic filenames.
# filepath = stringtools.remove_control_characters(filepath)
filepath = filepath.replace('/', os.sep)
filepath = filepath.replace('\\', os.sep)

View File

@ -779,7 +779,6 @@ class Photo(ObjectBase):
db_row = normalize_db_row(db_row, self.table)
self.real_path = db_row['filepath']
self.real_path = helpers.remove_path_badchars(self.real_path, allowed=':\\/')
self.real_path = pathclass.Path(self.real_path)
self.id = db_row['id']