server/search: fix underscores and percentages
Escape them for LIKE statements.
This commit is contained in:
parent
71a4ce8764
commit
0e31e1fd14
1 changed files with 4 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue