From 9b27e113b37ccefca54c682ac7cfdafc5beead46 Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 21 Jan 2017 00:20:32 +0100 Subject: [PATCH] server/search: escape backslashes in search --- server/szurubooru/search/configs/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/szurubooru/search/configs/util.py b/server/szurubooru/search/configs/util.py index 451179b9..7cb36e9f 100644 --- a/server/szurubooru/search/configs/util.py +++ b/server/szurubooru/search/configs/util.py @@ -6,8 +6,9 @@ from szurubooru.search import criteria def wildcard_transformer(value): return (value - .replace('%', r'\%') - .replace('_', r'\_') + .replace('\\', '\\\\') + .replace('%', '\\%') + .replace('_', '\\_') .replace('*', '%'))