projects
/
pgweb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
915aa6e
)
Don't crash on an incorrectly quoted suburl parameter
author
Magnus Hagander
<magnus@hagander.net>
Sun, 16 Dec 2018 15:10:40 +0000
(16:10 +0100)
committer
Magnus Hagander
<magnus@hagander.net>
Sun, 16 Dec 2018 15:10:40 +0000
(16:10 +0100)
pgweb/search/views.py
patch
|
blob
|
blame
|
history
diff --git
a/pgweb/search/views.py
b/pgweb/search/views.py
index b69353ccf2222d7c2f20144d37c4db6389ecf2ef..a89d7cd501f7c466ac0d9527566ca116d8479e5a 100644
(file)
--- a/
pgweb/search/views.py
+++ b/
pgweb/search/views.py
@@
-289,10
+289,17
@@
def search(request):
hits = curs.fetchall()
conn.close()
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" % (
urllib.quote_plus(query.encode('utf-8')),
allsites and "1" or "0",
-
suburl and urllib.quote_plus(suburl) or ''
,
+
quoted_suburl
,
)
return render(request, 'search/sitesearch.html', {