diff options
author | zotlabs <mike@macgirvin.com> | 2017-04-25 20:48:38 -0700 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-04-26 14:12:11 +0200 |
commit | 7667c630a4a682ba5a48d1ece173cdcdff575e00 (patch) | |
tree | e00b714ebb493dd7b6a32e148782a9c9b772e664 /Zotlabs | |
parent | 97458b288534d2270a592af141bacdcade84d12c (diff) | |
download | volse-hubzilla-7667c630a4a682ba5a48d1ece173cdcdff575e00.tar.gz volse-hubzilla-7667c630a4a682ba5a48d1ece173cdcdff575e00.tar.bz2 volse-hubzilla-7667c630a4a682ba5a48d1ece173cdcdff575e00.zip |
provide a broken feed for services which require a broken feed
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Feed.php | 49 | ||||
-rw-r--r-- | Zotlabs/Module/Wfinger.php | 18 | ||||
-rw-r--r-- | Zotlabs/Module/Xrd.php | 2 |
3 files changed, 37 insertions, 32 deletions
diff --git a/Zotlabs/Module/Feed.php b/Zotlabs/Module/Feed.php index 47871eafb..06637b6d2 100644 --- a/Zotlabs/Module/Feed.php +++ b/Zotlabs/Module/Feed.php @@ -1,40 +1,41 @@ <?php + namespace Zotlabs\Module; require_once('include/items.php'); - class Feed extends \Zotlabs\Web\Controller { function init() { - $params = array(); - - $params['begin'] = ((x($_REQUEST,'date_begin')) ? $_REQUEST['date_begin'] : NULL_DATE); - $params['end'] = ((x($_REQUEST,'date_end')) ? $_REQUEST['date_end'] : ''); - $params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml'); - $params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0); - $params['top'] = ((x($_REQUEST,'top')) ? intval($_REQUEST['top']) : 0); - $params['start'] = ((x($params,'start')) ? intval($params['start']) : 0); - $params['records'] = ((x($params,'records')) ? intval($params['records']) : 40); - $params['direction'] = ((x($params,'direction')) ? dbesc($params['direction']) : 'desc'); - $params['cat'] = ((x($_REQUEST,'cat')) ? escape_tags($_REQUEST['cat']) : ''); - - $channel = ''; + $params = []; + + $params['begin'] = ((x($_REQUEST,'date_begin')) ? $_REQUEST['date_begin'] : NULL_DATE); + $params['end'] = ((x($_REQUEST,'date_end')) ? $_REQUEST['date_end'] : ''); + $params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml'); + $params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0); + $params['top'] = ((x($_REQUEST,'top')) ? intval($_REQUEST['top']) : 0); + $params['start'] = ((x($params,'start')) ? intval($params['start']) : 0); + $params['records'] = ((x($params,'records')) ? intval($params['records']) : 40); + $params['direction'] = ((x($params,'direction')) ? dbesc($params['direction']) : 'desc'); + $params['cat'] = ((x($_REQUEST,'cat')) ? escape_tags($_REQUEST['cat']) : ''); + $params['compat'] = ((x($_REQUEST,'compat')) ? intval($_REQUEST['compat']) : 0); + + if(argc() > 1) { - $r = q("select * from channel left join xchan on channel_hash = xchan_hash where channel_address = '%s' limit 1", - dbesc(argv(1)) - ); - if(!($r && count($r))) + + if(observer_prohibited(true)) { killme(); - - $channel = $r[0]; - - if(observer_prohibited(true)) + } + + $channel = channelx_by_nick(argv(1)); + if(! $channel) { killme(); + } + - logger('mod_feed: public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $channel['channel_address']); + logger('public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $channel['channel_address']); echo get_public_feed($channel,$params); @@ -43,6 +44,4 @@ class Feed extends \Zotlabs\Web\Controller { } - - } diff --git a/Zotlabs/Module/Wfinger.php b/Zotlabs/Module/Wfinger.php index 5c22772c4..3fdff691b 100644 --- a/Zotlabs/Module/Wfinger.php +++ b/Zotlabs/Module/Wfinger.php @@ -94,33 +94,39 @@ class Wfinger extends \Zotlabs\Web\Controller { $result['links'] = [ [ - 'rel' => 'http://webfinger.net/rel/avatar', + 'rel' => 'http://webfinger.net/rel/avatar', 'type' => $r[0]['xchan_photo_mimetype'], 'href' => $r[0]['xchan_photo_l'] ], [ - 'rel' => 'http://webfinger.net/rel/profile-page', + 'rel' => 'http://webfinger.net/rel/profile-page', 'href' => z_root() . '/profile/' . $r[0]['channel_address'], ], [ - 'rel' => 'http://webfinger.net/rel/blog', + 'rel' => 'http://schemas.google.com/g/2010#updates-from', + 'type' => 'application/atom+xml', + 'href' => z_root() . '/feed/' . $r[0]['channel_address'] . '?f=&compat=1' + ], + + [ + 'rel' => 'http://webfinger.net/rel/blog', 'href' => z_root() . '/channel/' . $r[0]['channel_address'], ], [ - 'rel' => 'http://ostatus.org/schema/1.0/subscribe', + 'rel' => 'http://ostatus.org/schema/1.0/subscribe', 'template' => z_root() . '/follow/url={uri}', ], [ - 'rel' => 'http://purl.org/zot/protocol', + 'rel' => 'http://purl.org/zot/protocol', 'href' => z_root() . '/.well-known/zot-info' . '?address=' . $r[0]['xchan_addr'], ], [ - 'rel' => 'magic-public-key', + 'rel' => 'magic-public-key', 'href' => 'data:application/magic-public-key,' . salmon_key($r[0]['channel_pubkey']), ] ]; diff --git a/Zotlabs/Module/Xrd.php b/Zotlabs/Module/Xrd.php index 3ed19962b..ba650be55 100644 --- a/Zotlabs/Module/Xrd.php +++ b/Zotlabs/Module/Xrd.php @@ -57,7 +57,7 @@ class Xrd extends \Zotlabs\Web\Controller { '$aliases' => $aliases, '$profile_url' => z_root() . '/channel/' . $r[0]['channel_address'], '$hcard_url' => z_root() . '/hcard/' . $r[0]['channel_address'], - '$atom' => z_root() . '/feed/' . $r[0]['channel_address'], + '$atom' => z_root() . '/feed/' . $r[0]['channel_address'] . '?f=&compat=1', '$zot_post' => z_root() . '/post/' . $r[0]['channel_address'], '$poco_url' => z_root() . '/poco/' . $r[0]['channel_address'], '$photo' => z_root() . '/photo/profile/l/' . $r[0]['channel_id'], |