mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 00:36:38 -04:00
don't allow ? " or | in media filenames either
This commit is contained in:
parent
d401f92016
commit
7070b159d5
1 changed files with 1 additions and 1 deletions
|
@ -65,7 +65,7 @@ class MediaManager(object):
|
||||||
If the same name exists, compare checksums."""
|
If the same name exists, compare checksums."""
|
||||||
mdir = self.dir()
|
mdir = self.dir()
|
||||||
# remove any dangerous characters
|
# remove any dangerous characters
|
||||||
base = re.sub(r"[][<>:/\\&]", "", os.path.basename(opath))
|
base = re.sub(r"[][<>:/\\&?\"\|]", "", os.path.basename(opath))
|
||||||
dst = os.path.join(mdir, base)
|
dst = os.path.join(mdir, base)
|
||||||
# if it doesn't exist, copy it directly
|
# if it doesn't exist, copy it directly
|
||||||
if not os.path.exists(dst):
|
if not os.path.exists(dst):
|
||||||
|
|
Loading…
Reference in a new issue