# HG changeset patch # User Marcin Kuzminski # Date 2012-10-09 17:39:26 # Node ID bfffaa9aff580ff8d337da1429d1860b48e0a1e2 # Parent 976e2b032650ad0215b61460fe8aa58f78ae81a8 #589 search urlgenerator didn't properly escape special chars on url diff --git a/rhodecode/controllers/search.py b/rhodecode/controllers/search.py --- a/rhodecode/controllers/search.py +++ b/rhodecode/controllers/search.py @@ -24,7 +24,7 @@ # along with this program. If not, see . import logging import traceback - +import urllib from pylons.i18n.translation import _ from pylons import request, config, tmpl_context as c @@ -42,6 +42,7 @@ from whoosh.query import Phrase, Wildcar from rhodecode.model.repo import RepoModel from rhodecode.lib.utils2 import safe_str, safe_int + log = logging.getLogger(__name__) @@ -116,8 +117,9 @@ class SearchController(BaseController): ) def url_generator(**kw): + q = urllib.quote(safe_str(c.cur_query)) return update_params("?q=%s&type=%s" \ - % (safe_str(c.cur_query), safe_str(c.cur_type)), **kw) + % (q, safe_str(c.cur_type)), **kw) repo_location = RepoModel().repos_path c.formated_results = Page( WhooshResultWrapper(search_type, searcher, matcher,