]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/router.php
Resend confirm_address stuff, please read its NOTE first
[quix0rs-gnu-social.git] / lib / router.php
index bb87233b376213a02420c3c45fbeab1740db97e2..f66d928bcd98e2361bccbb5b62c7a44667dfbad3 100644 (file)
@@ -764,6 +764,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'));
@@ -1094,14 +1101,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)