return null;
}
-function common_local_url($action, $args=null, $params=null, $fragment=null)
+function common_local_url($action, $args=null, $params=null, $fragment=null, $addSession=true)
{
$r = Router::get();
$path = $r->build($action, $args, $params, $fragment);
$ssl = common_is_sensitive($action);
if (common_config('site','fancy')) {
- $url = common_path(mb_substr($path, 1), $ssl);
+ $url = common_path(mb_substr($path, 1), $ssl, $addSession);
} else {
if (mb_strpos($path, '/index.php') === 0) {
- $url = common_path(mb_substr($path, 1), $ssl);
+ $url = common_path(mb_substr($path, 1), $ssl, $addSession);
} else {
- $url = common_path('index.php'.$path, $ssl);
+ $url = common_path('index.php'.$path, $ssl, $addSession);
}
}
return $url;
return $ssl;
}
-function common_path($relative, $ssl=false)
+function common_path($relative, $ssl=false, $addSession=true)
{
$pathpart = (common_config('site', 'path')) ? common_config('site', 'path')."/" : '';
}
}
- $relative = common_inject_session($relative, $serverpart);
+ if ($addSession) {
+ $relative = common_inject_session($relative, $serverpart);
+ }
return $proto.'://'.$serverpart.'/'.$pathpart.$relative;
}
function common_profile_url($nickname)
{
- return common_local_url('showstream', array('nickname' => $nickname));
+ return common_local_url('showstream', array('nickname' => $nickname),
+ null, null, false);
}
// Should make up a reasonable root URL
function common_root_url($ssl=false)
{
- $url = common_path('', $ssl);
+ $url = common_path('', $ssl, false);
$i = strpos($url, '?');
if ($i !== false) {
$url = substr($url, 0, $i);
function common_user_uri(&$user)
{
- return common_local_url('userbyid', array('id' => $user->id));
+ return common_local_url('userbyid', array('id' => $user->id),
+ null, null, false);
}
function common_notice_uri(&$notice)