1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

wip injection fix

This commit is contained in:
Fabio De Simone 2019-01-28 22:45:56 +01:00 committed by Stefano Pigozzi
parent 84cb24a51a
commit 1a39415a8d

View file

@ -298,6 +298,7 @@ def cmd_search(bot: Bot, update: Update):
text = update.message.text.split(" ", 1)[1] text = update.message.text.split(" ", 1)[1]
if text is None: if text is None:
return return
text = text.replace('%','\\%').replace('_','\_')
entries = session.query(db.Diario).filter(db.Diario.text.ilike('%'+text+'%')).all() entries = session.query(db.Diario).filter(db.Diario.text.ilike('%'+text+'%')).all()
messageText = "Ecco i risulati della ricerca:\n" messageText = "Ecco i risulati della ricerca:\n"
for entry in entries[:5]: for entry in entries[:5]: