git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 3a999af4 authored by Evan Prodromou's avatar Evan Prodromou

Change common_local_url() to take 4 arguments

I changed common_local_url() to take an additional optional argument
-- for query parameters. Being persnickety, I made it the third of
four, and moved the last one ($fragment) down a slot. That required
changing a couple of calls.
parent f39dd40f
...@@ -204,7 +204,7 @@ class TwitapistatusesAction extends TwitterapiAction ...@@ -204,7 +204,7 @@ class TwitapistatusesAction extends TwitterapiAction
# FriendFeed's SUP protocol # FriendFeed's SUP protocol
# Also added RSS and Atom feeds # Also added RSS and Atom feeds
$suplink = common_local_url('sup', null, $user->id); $suplink = common_local_url('sup', null, null, $user->id);
header('X-SUP-ID: '.$suplink); header('X-SUP-ID: '.$suplink);
# XXX: since # XXX: since
......
...@@ -46,13 +46,13 @@ class UserrssAction extends Rss10Action ...@@ -46,13 +46,13 @@ class UserrssAction extends Rss10Action
{ {
$user = $this->user; $user = $this->user;
if (is_null($user)) { if (is_null($user)) {
return null; return null;
} }
$notice = $user->getNotices(0, ($limit == 0) ? NOTICES_PER_PAGE : $limit); $notice = $user->getNotices(0, ($limit == 0) ? NOTICES_PER_PAGE : $limit);
while ($notice->fetch()) { while ($notice->fetch()) {
$notices[] = clone($notice); $notices[] = clone($notice);
} }
...@@ -87,10 +87,10 @@ class UserrssAction extends Rss10Action ...@@ -87,10 +87,10 @@ class UserrssAction extends Rss10Action
} }
# override parent to add X-SUP-ID URL # override parent to add X-SUP-ID URL
function initRss($limit=0) function initRss($limit=0)
{ {
$url = common_local_url('sup', null, $this->user->id); $url = common_local_url('sup', null, null, $this->user->id);
header('X-SUP-ID: '.$url); header('X-SUP-ID: '.$url);
parent::initRss($limit); parent::initRss($limit);
} }
...@@ -100,4 +100,3 @@ class UserrssAction extends Rss10Action ...@@ -100,4 +100,3 @@ class UserrssAction extends Rss10Action
return true; return true;
} }
} }
...@@ -350,7 +350,7 @@ class Router ...@@ -350,7 +350,7 @@ class Router
return $this->m->match($path); return $this->m->match($path);
} }
function build($action, $args=null, $fragment=null) function build($action, $args=null, $params=null, $fragment=null)
{ {
$action_arg = array('action' => $action); $action_arg = array('action' => $action);
...@@ -360,6 +360,6 @@ class Router ...@@ -360,6 +360,6 @@ class Router
$args = $action_arg; $args = $action_arg;
} }
return $this->m->generate($args, null, $fragment); return $this->m->generate($args, $params, $fragment);
} }
} }
\ No newline at end of file
...@@ -705,10 +705,10 @@ function common_relative_profile($sender, $nickname, $dt=null) ...@@ -705,10 +705,10 @@ function common_relative_profile($sender, $nickname, $dt=null)
return null; return null;
} }
function common_local_url($action, $args=null, $fragment=null) function common_local_url($action, $args=null, $params=null, $fragment=null)
{ {
$r = Router::get(); $r = Router::get();
$path = $r->build($action, $args, $fragment); $path = $r->build($action, $args, $params, $fragment);
if ($path) { if ($path) {
} }
if (common_config('site','fancy')) { if (common_config('site','fancy')) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment