##// END OF EJS Templates
#589 search urlgenerator didn't properly escape special chars on url
marcink -
r2913:bfffaa9a beta
parent child Browse files
Show More
@@ -24,7 +24,7 b''
24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25 import logging
25 import logging
26 import traceback
26 import traceback
27
27 import urllib
28 from pylons.i18n.translation import _
28 from pylons.i18n.translation import _
29 from pylons import request, config, tmpl_context as c
29 from pylons import request, config, tmpl_context as c
30
30
@@ -42,6 +42,7 b' from whoosh.query import Phrase, Wildcar'
42 from rhodecode.model.repo import RepoModel
42 from rhodecode.model.repo import RepoModel
43 from rhodecode.lib.utils2 import safe_str, safe_int
43 from rhodecode.lib.utils2 import safe_str, safe_int
44
44
45
45 log = logging.getLogger(__name__)
46 log = logging.getLogger(__name__)
46
47
47
48
@@ -116,8 +117,9 b' class SearchController(BaseController):'
116 )
117 )
117
118
118 def url_generator(**kw):
119 def url_generator(**kw):
120 q = urllib.quote(safe_str(c.cur_query))
119 return update_params("?q=%s&type=%s" \
121 return update_params("?q=%s&type=%s" \
120 % (safe_str(c.cur_query), safe_str(c.cur_type)), **kw)
122 % (q, safe_str(c.cur_type)), **kw)
121 repo_location = RepoModel().repos_path
123 repo_location = RepoModel().repos_path
122 c.formated_results = Page(
124 c.formated_results = Page(
123 WhooshResultWrapper(search_type, searcher, matcher,
125 WhooshResultWrapper(search_type, searcher, matcher,
General Comments 0
You need to be logged in to leave comments. Login now