mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-06 09:57:57 +00:00
Don't crash on an incorrectly quoted suburl parameter
This commit is contained in:
@ -289,10 +289,17 @@ def search(request):
|
|||||||
hits = curs.fetchall()
|
hits = curs.fetchall()
|
||||||
conn.close()
|
conn.close()
|
||||||
totalhits = int(hits[-1][5])
|
totalhits = int(hits[-1][5])
|
||||||
|
try:
|
||||||
|
if quoted_suburl:
|
||||||
|
quoted_suburl = urllib.quote_plus(suburl)
|
||||||
|
else:
|
||||||
|
quoted_suburl = ''
|
||||||
|
except:
|
||||||
|
quoted_suburl = ''
|
||||||
querystr = "?q=%s&a=%s&u=%s" % (
|
querystr = "?q=%s&a=%s&u=%s" % (
|
||||||
urllib.quote_plus(query.encode('utf-8')),
|
urllib.quote_plus(query.encode('utf-8')),
|
||||||
allsites and "1" or "0",
|
allsites and "1" or "0",
|
||||||
suburl and urllib.quote_plus(suburl) or '',
|
quoted_suburl,
|
||||||
)
|
)
|
||||||
|
|
||||||
return render(request, 'search/sitesearch.html', {
|
return render(request, 'search/sitesearch.html', {
|
||||||
|
Reference in New Issue
Block a user