changeset 1235:c6ae37934d31

saner url manipulation
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Tue, 08 Aug 2006 22:10:25 +0200
parents e38e27967a97
children d2d160c344b7
files MoinMoin/search/results.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/results.py	Tue Aug 08 16:30:24 2006 +0200
+++ b/MoinMoin/search/results.py	Tue Aug 08 22:10:25 2006 +0200
@@ -651,10 +651,11 @@
         _ = self.request.getText
         f = self.formatter
 
-        # url magic
-        from_re = r'\&from=[\d]+'
-        uri = re.sub(from_re, '', self.request.request_uri)
-        page_url = lambda n: '%s&from=%i' % (uri, n * hitsPerPage)
+        querydict = wikiutil.parseQueryString(self.request.query_string)
+        uri_prefix = self.request.splitURI(self.request.request_uri)[0]
+        def page_url(n):
+            querydict.update({'from': n * hitsPerPage})
+            return uri_prefix + '?' + wikiutil.makeQueryString(querydict)
         
         pages = float(hitsNum) / hitsPerPage
         if pages - int(pages) > 0.0: