server/search: fix underscores and percentages

Escape them for LIKE statements.
This commit is contained in:
rr- 2016-09-26 21:56:19 +02:00
parent 71a4ce8764
commit 0e31e1fd14

View file

@ -5,7 +5,10 @@ from szurubooru.search import criteria
def wildcard_transformer(value):
return value.replace('*', '%')
return (value
.replace('%', r'\%')
.replace('_', r'\_')
.replace('*', '%'))
def apply_num_criterion_to_column(column, criterion):