Sanitize search query

This commit is contained in:
Tastyfish
2016-04-11 03:27:06 -04:00
parent 65432404fa
commit b9a161222f
+3 -3
View File
@@ -33,13 +33,13 @@
var/where = 0
if(query)
if(query.title && query.title != "")
searchquery += " WHERE title LIKE '%[query.title]%'"
searchquery += " WHERE title LIKE '%[sanitizeSQL(query.title)]%'"
where = 1
if(query.author && query.author != "")
searchquery += " [!where ? "WHERE" : "AND"] author LIKE '%[query.author]%'"
searchquery += " [!where ? "WHERE" : "AND"] author LIKE '%[sanitizeSQL(query.author)]%'"
where = 1
if(query.category && query.category != "")
searchquery += " [!where ? "WHERE" : "AND"] category LIKE '%[query.category]%'"
searchquery += " [!where ? "WHERE" : "AND"] category LIKE '%[sanitizeSQL(query.category)]%'"
if(query.category == "Fiction")
searchquery += " AND category NOT LIKE '%Non-Fiction%'"
where = 1