Skip to content

Commit

Permalink
Merge pull request #1663 from OmniLayer/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
achamely committed Jul 30, 2018
2 parents ec93e8e + 71ce3e8 commit 96362c8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/search_service.py
Expand Up @@ -20,6 +20,14 @@ def search():
query = re.sub(r'\W+', '0', request.args.get('query') ) # strip and get query
else:
return jsonify({ 'status': 400, 'data': 'No query found in request' })


if query[:2] in ['0x','0X']:
return jsonify({ 'status': 400, 'data': 'Invalid search query prefix.' })

if len(query) < 3:
return jsonify({ 'status': 400, 'data': 'Search query to short.' })

ROWS=dbSelect("select * from transactions t, txjson txj where t.txhash ~* \'" + str(query) + "\' and t.txdbserialnum=txj.txdbserialnum")

response = []
Expand Down

0 comments on commit 96362c8

Please sign in to comment.