]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Changes to router setup to make notice search RSS feed work
authorCiaranG <ciaran@ciarang.com>
Sat, 21 Mar 2009 14:16:54 +0000 (14:16 +0000)
committerCiaranG <ciaran@ciarang.com>
Sat, 21 Mar 2009 14:16:54 +0000 (14:16 +0000)
lib/router.php

index e39dc217a36fb87192a483b07852e0c2ff6941dd..83b3ffe607ebd009447d97f16b34baa7b0ddf5fd 100644 (file)
@@ -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
 
@@ -421,6 +425,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) {
@@ -429,6 +435,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);
     }
 }