server/search: escape backslashes in search

This commit is contained in:
rr- 2017-01-21 00:20:32 +01:00
parent 783171729f
commit 9b27e113b3

View file

@ -6,8 +6,9 @@ from szurubooru.search import criteria
def wildcard_transformer(value): def wildcard_transformer(value):
return (value return (value
.replace('%', r'\%') .replace('\\', '\\\\')
.replace('_', r'\_') .replace('%', '\\%')
.replace('_', '\\_')
.replace('*', '%')) .replace('*', '%'))