Disable remove_control_characters under path_badchars indefinitely.

This commit is contained in:
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) badchars = stringtools.remove_characters(constants.FILENAME_BADCHARS, allowed)
filepath = stringtools.remove_characters(filepath, badchars) 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)
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) db_row = normalize_db_row(db_row, self.table)
self.real_path = db_row['filepath'] 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.real_path = pathclass.Path(self.real_path)
self.id = db_row['id'] self.id = db_row['id']