* @link http://status.net/
*/
-if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* URL 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]+'));
'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'));
foreach (array('subscriptions', 'subscribers',
'all', 'foaf', 'replies',
- 'microsummary') as $a) {
+ ) as $a) {
$m->connect($a,
array('action' => $a,
'nickname' => $nickname));
$m->connect('all/:tag',
array('action' => 'showprofiletag',
+ 'nickname' => $nickname,
'tag' => self::REGEX_TAG));
foreach (array('subscriptions', 'subscribers') as $a) {
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));
'tagger_id' => '[0-9]+',
'id' => '[0-9]+'));
- $m->connect(':tagger/all/:tag',
- array('action' => 'showprofiletag',
- 'tagger' => Nickname::DISPLAY_FMT,
+ $m->connect(':nickname/all/:tag',
+ array('action' => 'showprofiletag'),
+ array('nickname' => Nickname::DISPLAY_FMT,
'tag' => self::REGEX_TAG));
foreach (array('subscriptions', 'subscribers') as $a) {
function map($path)
{
try {
- $match = $this->m->match($path);
- } catch (Exception $e) {
- common_log(LOG_ERR, "Problem getting route for $path - " .
- $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.
- $cac = new ClientErrorAction(_('Page not found.'), 404);
- $cac->showPage();
+ throw new ClientException(_('Page not found.'), 404);
}
-
- return $match;
}
function build($action, $args=null, $params=null, $fragment=null)