diff options
author | CiaranG <ciaran@ciarang.com> | 2009-03-25 15:39:58 +0000 |
---|---|---|
committer | CiaranG <ciaran@ciarang.com> | 2009-03-25 15:39:58 +0000 |
commit | 2c8f67f6a9b4e93161e7cae0c38162cb8991e0ef (patch) | |
tree | 67b22fdf2ec8d5bace5dd8480030d2ea1d19ef47 /lib/router.php | |
parent | 66a2f4c64b8cf9949503f992ce8571244e213bab (diff) |
A different search pagination fix (see ticket #1333) that doesn't require fixing the upstream code, thus undoing the change made in d64be5108d69ff4068d4383ab121a3ba7388ada3
Diffstat (limited to 'lib/router.php')
-rw-r--r-- | lib/router.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/router.php b/lib/router.php index 83b3ffe60..d1217ca3c 100644 --- a/lib/router.php +++ b/lib/router.php @@ -437,6 +437,16 @@ class Router if($params!=null) common_log(LOG_DEBUG,"generate args:".print_r($args,true)); - return $this->m->generate($args, $params, $fragment); + $url=$this->m->generate($args, $params, $fragment); + + // Due to a bug in the Net_URL_Mapper code, the returned URL may + // contain a malformed query of the form ?p1=v1?p2=v2?p3=v3. We + // repair that here rather than modifying the upstream code... + $qpos = strpos($url,'?'); + if ($qpos !== false) { + $url = substr($url, 0, $qpos+1) . + str_replace('?', '&', substr($url, $qpos+1)); + } + return $url; } } |