Disable remove_control_characters under path_badchars indefinitely.
This commit is contained in:
parent
c4ea7c31ac
commit
c40deb3631
2 changed files with 5 additions and 2 deletions
|
@ -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)
|
||||||
|
|
|
@ -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']
|
||||||
|
|
Loading…
Reference in a new issue