summaryrefslogtreecommitdiff
path: root/lib/router.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/router.php')
-rw-r--r--lib/router.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/router.php b/lib/router.php
index d0b56e88b..5a00a7fea 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -136,10 +136,14 @@ class Router
foreach (array('group', 'people', 'notice') as $s) {
$m->connect('search/'.$s, array('action' => $s.'search'));
- $m->connect('search/'.$s.'?q=:q', array('action' => $s.'search'), array('q' => '.+'));
+ $m->connect('search/'.$s.'?q=:q', array('action' => $s.'search'),array('q' => '.+'));
}
+ // The second of these is needed to make the link work correctly
+ // when inserted into the page. The first is needed to match the
+ // route on the way in. Seems to be another Net_URL_Mapper bug to me.
$m->connect('search/notice/rss', array('action' => 'noticesearchrss'));
+ $m->connect('search/notice/rss?q=:q', array('action' => 'noticesearchrss'),array('q' => '.+'));
// notice
@@ -162,7 +166,7 @@ class Router
array('id' => '[0-9]+'));
$m->connect('message/new', array('action' => 'newmessage'));
- $m->connect('message/new?to=:to', array('action' => 'newmessage'), array('to' => '[A-Za-z0-9_-]'));
+ $m->connect('message/new?to=:to', array('action' => 'newmessage'), array('to' => '[A-Za-z0-9_-]+'));
$m->connect('message/:message',
array('action' => 'showmessage'),
array('message' => '[0-9]+'));
@@ -427,6 +431,8 @@ class Router
function build($action, $args=null, $params=null, $fragment=null)
{
+ if($params!=null)
+ common_log(LOG_DEBUG,"build: ".$action." ".print_r($args,true)." ".print_r($params,true));
$action_arg = array('action' => $action);
if ($args) {
@@ -435,6 +441,8 @@ class Router
$args = $action_arg;
}
+ if($params!=null)
+ common_log(LOG_DEBUG,"generate args:".print_r($args,true));
return $this->m->generate($args, $params, $fragment);
}
}