]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/router.php
Merge branch 'nightly' into 'nightly'
[quix0rs-gnu-social.git] / lib / router.php
index bb87233b376213a02420c3c45fbeab1740db97e2..ab6595b8f8a51b44bd12692f2ef261b4a512bd14 100644 (file)
@@ -223,6 +223,10 @@ class Router
                         array('action' => 'attachment'),
                         array('attachment' => '[0-9]+'));
 
+            $m->connect('attachment/:attachment/download',
+                        array('action' => 'attachment_download'),
+                        array('attachment' => '[0-9]+'));
+
             $m->connect('attachment/:attachment/thumbnail',
                         array('action' => 'attachment_thumbnail'),
                         array('attachment' => '[0-9]+'));
@@ -256,12 +260,6 @@ class Router
                         array('action' => 'userbyid'),
                         array('id' => '[0-9]+'));
 
-            if (!common_config('performance', 'high')) {
-                $m->connect('tags/', array('action' => 'publictagcloud'));
-                $m->connect('tag/', array('action' => 'publictagcloud'));
-                $m->connect('tags', array('action' => 'publictagcloud'));
-                $m->connect('tag', array('action' => 'publictagcloud'));
-            }
             $m->connect('tag/:tag/rss',
                         array('action' => 'tagrss'),
                         array('tag' => self::REGEX_TAG));
@@ -422,7 +420,7 @@ class Router
 
             $m->connect('api/statuses/update.:format',
                         array('action' => 'ApiStatusesUpdate',
-                              'format' => '(xml|json)'));
+                              'format' => '(xml|json|atom)'));
 
             $m->connect('api/statuses/destroy/:id.:format',
                         array('action' => 'ApiStatusesDestroy',
@@ -764,6 +762,13 @@ class Router
                 'api/statuses/update_with_media.json',
                 array('action' => 'ApiMediaUpload')
             );
+            // Twitter Media upload API v1.1
+            $m->connect(
+                'api/media/upload.:format',
+                array('action' => 'ApiMediaUpload',
+                      'format' => '(xml|json)',
+                      )
+            );
 
             // search
             $m->connect('api/search.atom', array('action' => 'ApiSearchAtom'));
@@ -825,7 +830,7 @@ class Router
 
                 foreach (array('subscriptions', 'subscribers',
                                'all', 'foaf', 'replies',
-                               'microsummary') as $a) {
+                               ) as $a) {
                     $m->connect($a,
                                 array('action' => $a,
                                       'nickname' => $nickname));
@@ -937,7 +942,7 @@ class Router
 
             foreach (array('subscriptions', 'subscribers',
                            'nudge', 'all', 'foaf', 'replies',
-                           'inbox', 'outbox', 'microsummary') as $a) {
+                           'inbox', 'outbox') as $a) {
                 $m->connect(':nickname/'.$a,
                             array('action' => $a),
                             array('nickname' => Nickname::DISPLAY_FMT));
@@ -1094,14 +1099,12 @@ class Router
     function map($path)
     {
         try {
-            $match = $this->m->match($path);
-        } catch (Exception $e) {
-            common_debug('Problem getting route for '._ve($path).' - '._ve($e->getMessage()));
+            return $this->m->match($path);
+        } catch (NoRouteMapException $e) {
+            common_debug($e->getMessage());
             // TRANS: Client error on action trying to visit a non-existing page.
             throw new ClientException(_('Page not found.'), 404);
         }
-
-        return $match;
     }
 
     function build($action, $args=null, $params=null, $fragment=null)