Skip to content

Commit

Permalink
fix: address corner cases in filename sanitization (#1070)
Browse files Browse the repository at this point in the history
* fix: address corner cases in filename sanitization

* bugfix: #1086, original commit: a987a17

---------

Co-authored-by: Zollty Tsou <[email protected]>
  • Loading branch information
Yefori-Go and zollty authored Apr 2, 2024
1 parent 72209a0 commit 1b8e2c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,9 +867,9 @@ def myprint(**args):

def replace_special_symbols(string, replace_string=" "):
# 定义正则表达式,匹配所有特殊符号
pattern = r"[!@#$%^&*()<>?/\|}{~:]"
pattern = r"[\\/\'\"!@#$%^&*()<>?/\|}{~:]"

new_string = re.sub(pattern, replace_string, string)
new_string = re.sub(pattern, replace_string, string).strip()

return new_string

Expand Down

0 comments on commit 1b8e2c6

Please sign in to comment.