summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-03-06 21:11:19 -0800
committerZach Copley <zach@controlyourself.ca>2009-03-06 21:11:19 -0800
commit597e1988b0dbe0b3eacbeadadad2655b457d2496 (patch)
tree17616121fdb659856cebb3b28e2aafe75bd00978 /lib
parentac7170bf6cbf36699cf182ccb1bd5214f6e8741e (diff)
parent16a6aa53907de29c6d993fd18e62d45e4380f451 (diff)
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
Diffstat (limited to 'lib')
-rw-r--r--lib/router.php7
-rw-r--r--lib/util.php9
2 files changed, 9 insertions, 7 deletions
diff --git a/lib/router.php b/lib/router.php
index 516b48122..d34b84cd4 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -49,6 +49,8 @@ class Router
{
var $m = null;
static $inst = null;
+ static $bare = array('requesttoken', 'accesstoken', 'userauthorization',
+ 'postnotice', 'updateprofile', 'finishremotesubscribe');
static function get()
{
@@ -118,8 +120,7 @@ class Router
$m->connect('main/remote', array('action' => 'remotesubscribe'));
$m->connect('main/remote?nickname=:nickname', array('action' => 'remotesubscribe'), array('nickname' => '[A-Za-z0-9_-]+'));
- foreach (array('requesttoken', 'accesstoken', 'userauthorization',
- 'postnotice', 'updateprofile', 'finishremotesubscribe') as $action) {
+ foreach (Router::$bare as $action) {
$m->connect('index.php?action=' . $action, array('action' => $action));
}
@@ -277,7 +278,6 @@ class Router
'apiaction' => 'friendships'),
array('method' => 'exists(\.(xml|json|rss|atom))'));
-
// Social graph
$m->connect('api/friends/ids/:argument',
@@ -352,7 +352,6 @@ class Router
array('action' => 'api',
'apiaction' => 'laconica'));
-
// search
$m->connect('api/search.atom', array('action' => 'twitapisearchatom'));
$m->connect('api/search.json', array('action' => 'twitapisearchjson'));
diff --git a/lib/util.php b/lib/util.php
index 9637dc506..ca8376f28 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -722,12 +722,15 @@ function common_local_url($action, $args=null, $params=null, $fragment=null)
{
$r = Router::get();
$path = $r->build($action, $args, $params, $fragment);
- if ($path) {
- }
+
if (common_config('site','fancy')) {
$url = common_path(mb_substr($path, 1));
} else {
- $url = common_path('index.php'.$path);
+ if (mb_strpos($path, '/index.php') === 0) {
+ $url = common_path(mb_substr($path, 1));
+ } else {
+ $url = common_path('index.php'.$path);
+ }
}
return $url;
}