]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Some fixes for OpenID and OMB URLs
authorEvan Prodromou <evan@controlyourself.ca>
Sat, 7 Mar 2009 01:18:21 +0000 (17:18 -0800)
committerEvan Prodromou <evan@controlyourself.ca>
Sat, 7 Mar 2009 01:18:21 +0000 (17:18 -0800)
lib/router.php
lib/util.php

index 516b48122706c9b48a014181911284dfef88b713..d34b84cd43fe0f264ae48a25974795fe1656799c 100644 (file)
@@ -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'));
index 9637dc5063aa541b9f065a66a00f7d4d9822e366..ca8376f2875a9db088c3f45c39679aad9dc885a5 100644 (file)
@@ -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;
 }