diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-06-23 13:06:40 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-06-23 13:06:40 +0200 |
commit | 30ba2803e7a4f9266fd72d19c54e1cb46190702a (patch) | |
tree | d522c292170fba4db6cee8505b5a1e1a19ba3803 /include | |
parent | b6c4601d8fe96d53428697dd98d085f3602b2e6e (diff) | |
parent | 45d66657d747e106e451e9e0e2bea468b25eb973 (diff) | |
download | volse-hubzilla-30ba2803e7a4f9266fd72d19c54e1cb46190702a.tar.gz volse-hubzilla-30ba2803e7a4f9266fd72d19c54e1cb46190702a.tar.bz2 volse-hubzilla-30ba2803e7a4f9266fd72d19c54e1cb46190702a.zip |
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Diffstat (limited to 'include')
-rwxr-xr-x | include/diaspora.php | 26 | ||||
-rwxr-xr-x | include/items.php | 6 |
2 files changed, 29 insertions, 3 deletions
diff --git a/include/diaspora.php b/include/diaspora.php index 33ad4211b..77a400604 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -2371,6 +2371,24 @@ function diaspora_profile($importer,$xml,$msg) { function diaspora_share($owner,$contact) { $a = get_app(); + + $enabled = intval(get_config('system','diaspora_enabled')); + if(! $enabled) { + logger('diaspora_share: disabled'); + return; + } + + $allowed = get_pconfig($owner['channel_id'],'system','diaspora_allowed'); + if($allowed === false) + $allowed = 1; + + if(! intval($allowed)) { + logger('diaspora_share: disallowed for channel ' . $importer['channel_name']); + return; + } + + + $myaddr = $owner['channel_address'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3); if(! array_key_exists('xchan_hash',$contact)) { @@ -2947,6 +2965,14 @@ function diaspora_transmit($owner,$contact,$slap,$public_batch,$queue_run=false) return 200; } + $allowed = get_pconfig($owner['channel_id'],'system','diaspora_allowed'); + if($allowed === false) + $allowed = 1; + + if(! intval($allowed)) { + return 200; + } + if($public_batch) $dest_url = $contact['hubloc_callback'] . '/public'; else diff --git a/include/items.php b/include/items.php index eb4ad1ead..229512ead 100755 --- a/include/items.php +++ b/include/items.php @@ -423,7 +423,7 @@ function post_activity_item($arr) { if(array_key_exists('item_private',$arr) && $arr['item_private']) { - $arr['body'] = z_input_filter($arr['uid'],$arr['body'],$arr['mimetype']); + $arr['body'] = trim(z_input_filter($arr['uid'],$arr['body'],$arr['mimetype'])); if($channel) { if($channel['channel_hash'] === $arr['author_xchan']) { @@ -2064,7 +2064,7 @@ function item_store($arr, $allow_exec = false) { $arr['lang'] = detect_language($arr['body']); // apply the input filter here - if it is obscured it has been filtered already - $arr['body'] = z_input_filter($arr['uid'],$arr['body'],$arr['mimetype']); + $arr['body'] = trim(z_input_filter($arr['uid'],$arr['body'],$arr['mimetype'])); if(local_channel() && (! $arr['sig'])) { $channel = get_app()->get_channel(); @@ -2461,7 +2461,7 @@ function item_store_update($arr,$allow_exec = false) { $arr['lang'] = detect_language($arr['body']); // apply the input filter here - if it is obscured it has been filtered already - $arr['body'] = z_input_filter($arr['uid'],$arr['body'],$arr['mimetype']); + $arr['body'] = trim(z_input_filter($arr['uid'],$arr['body'],$arr['mimetype'])); if(local_channel() && (! $arr['sig'])) { $channel = get_app()->get_channel(); |