aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/conversation.php6
-rwxr-xr-xinclude/items.php20
-rw-r--r--include/text.php16
-rw-r--r--include/zot.php8
4 files changed, 21 insertions, 29 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 957dbf8e9..1efca37f3 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -99,7 +99,7 @@ function localize_item(&$item){
if(intval($item['item_thread_top']))
return;
- $obj = json_decode_plus($item['obj']);
+ $obj = json_decode($item['obj'],true);
if((! $obj) && ($item['obj'])) {
logger('localize_item: failed to decode object: ' . print_r($item['obj'],true));
}
@@ -186,7 +186,7 @@ function localize_item(&$item){
$Alink = $item['author']['xchan_url'];
- $obj= json_decode_plus($item['obj']);
+ $obj= json_decode($item['obj'],true);
$Blink = $Bphoto = '';
@@ -219,7 +219,7 @@ function localize_item(&$item){
$Aname = $item['author']['xchan_name'];
$Alink = $item['author']['xchan_url'];
- $obj= json_decode_plus($item['obj']);
+ $obj= json_decode($item['obj'],true);
$Blink = $Bphoto = '';
diff --git a/include/items.php b/include/items.php
index 373090d41..ad12e4f98 100755
--- a/include/items.php
+++ b/include/items.php
@@ -990,9 +990,9 @@ function encode_item($item,$mirror = false) {
if(array_key_exists('item_obscured',$item) && intval($item['item_obscured'])) {
if($item['title'])
- $item['title'] = crypto_unencapsulate(json_decode_plus($item['title']),$key);
+ $item['title'] = crypto_unencapsulate(json_decode($item['title'],true),$key);
if($item['body'])
- $item['body'] = crypto_unencapsulate(json_decode_plus($item['body']),$key);
+ $item['body'] = crypto_unencapsulate(json_decode($item['body'],true),$key);
}
// If we're trying to backup an item so that it's recoverable or for export/imprt,
@@ -1062,11 +1062,11 @@ function encode_item($item,$mirror = false) {
$x['owner'] = encode_item_xchan($item['owner']);
$x['author'] = encode_item_xchan($item['author']);
if($item['obj'])
- $x['object'] = json_decode_plus($item['obj']);
+ $x['object'] = json_decode($item['obj'],true);
if($item['target'])
- $x['target'] = json_decode_plus($item['target']);
+ $x['target'] = json_decode($item['target'],true);
if($item['attach'])
- $x['attach'] = json_decode_plus($item['attach']);
+ $x['attach'] = json_decode($item['attach'],true);
if($y = encode_item_flags($item))
$x['flags'] = $y;
@@ -1382,7 +1382,7 @@ function encode_mail($item,$extended = false) {
$x['to'] = encode_item_xchan($item['to']);
if($item['attach'])
- $x['attach'] = json_decode_plus($item['attach']);
+ $x['attach'] = json_decode($item['attach'],true);
$x['flags'] = array();
@@ -2390,7 +2390,7 @@ function tag_deliver($uid, $item_id) {
if(($item['obj_type'] == "") || ($item['obj_type'] !== ACTIVITY_OBJ_PERSON) || (! $item['obj']))
$poke_notify = false;
- $obj = json_decode_plus($item['obj']);
+ $obj = json_decode($item['obj'],true);
if($obj) {
if($obj['id'] !== $u[0]['channel_hash'])
$poke_notify = false;
@@ -2427,14 +2427,14 @@ function tag_deliver($uid, $item_id) {
if(($item['owner_xchan'] === $u[0]['channel_hash']) && (! get_pconfig($u[0]['channel_id'],'system','blocktags'))) {
logger('tag_deliver: community tag recipient: ' . $u[0]['channel_name']);
- $j_tgt = json_decode_plus($item['target']);
+ $j_tgt = json_decode($item['target'],true);
if($j_tgt && $j_tgt['id']) {
$p = q("select * from item where mid = '%s' and uid = %d limit 1",
dbesc($j_tgt['id']),
intval($u[0]['channel_id'])
);
if($p) {
- $j_obj = json_decode_plus($item['obj']);
+ $j_obj = json_decode($item['obj'],true);
logger('tag_deliver: tag object: ' . print_r($j_obj,true), LOGGER_DATA);
if($j_obj && $j_obj['id'] && $j_obj['title']) {
if(is_array($j_obj['link']))
@@ -2519,7 +2519,7 @@ function tag_deliver($uid, $item_id) {
if(intval($item['item_obscured'])) {
$key = get_config('system','prvkey');
if($item['body'])
- $body = crypto_unencapsulate(json_decode_plus($item['body']),$key);
+ $body = crypto_unencapsulate(json_decode($item['body'],true),$key);
}
else
$body = $item['body'];
diff --git a/include/text.php b/include/text.php
index 986e3b56c..ba7d9cc5b 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1280,9 +1280,9 @@ function unobscure(&$item) {
if(array_key_exists('item_obscured',$item) && intval($item['item_obscured'])) {
$key = get_config('system','prvkey');
if($item['title'])
- $item['title'] = crypto_unencapsulate(json_decode_plus($item['title']),$key);
+ $item['title'] = crypto_unencapsulate(json_decode($item['title'],true),$key);
if($item['body'])
- $item['body'] = crypto_unencapsulate(json_decode_plus($item['body']),$key);
+ $item['body'] = crypto_unencapsulate(json_decode($item['body'],true),$key);
if(get_config('system','item_cache')) {
q("update item set title = '%s', body = '%s', item_obscured = 0 where id = %d",
dbesc($item['title']),
@@ -1305,7 +1305,7 @@ function unobscure_mail(&$item) {
function theme_attachments(&$item) {
- $arr = json_decode_plus($item['attach']);
+ $arr = json_decode($item['attach'],true);
if(is_array($arr) && count($arr)) {
$attaches = array();
foreach($arr as $r) {
@@ -2208,20 +2208,12 @@ function jindent($json) {
return $result;
}
-
-function json_decode_plus($s) {
- $x = json_decode($s,true);
- if(! $x)
- $x = json_decode(str_replace(array('\\"','\\\\'),array('"','\\'),$s),true);
-
- return $x;
-}
-
/**
* @brief Creates navigation menu for webpage, layout, blocks, menu sites.
*
* @return string
*/
+
function design_tools() {
$channel = App::get_channel();
diff --git a/include/zot.php b/include/zot.php
index 0bf689742..d506e96fe 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -506,7 +506,7 @@ function zot_refresh($them, $channel = null, $force = false) {
));
if(intval($permissions['view_stream'])) {
- if(intval(get_pconfig($channel['channel_id'],'perms_limit','send_stream') & PERMS_PENDING)
+ if(intval(get_pconfig($channel['channel_id'],'perm_limits','send_stream') & PERMS_PENDING)
|| (! intval($new_connection[0]['abook_pending'])))
Zotlabs\Daemon\Master::Summon(array('Onepoll',$new_connection[0]['abook_id']));
}
@@ -1395,7 +1395,7 @@ function public_recips($msg) {
}
}
- //logger('message: ' . print_r($msg['message'],true));
+ // logger('message: ' . print_r($msg['message'],true));
if($include_sys && array_key_exists('public_scope',$msg['message']) && $msg['message']['public_scope'] === 'public') {
$sys = get_sys_channel();
@@ -1881,9 +1881,9 @@ function remove_community_tag($sender, $arr, $uid) {
$i = $r[0];
if($i['target'])
- $i['target'] = json_decode_plus($i['target']);
+ $i['target'] = json_decode($i['target'],true);
if($i['object'])
- $i['object'] = json_decode_plus($i['object']);
+ $i['object'] = json_decode($i['object'],true);
if(! ($i['target'] && $i['object'])) {
logger('remove_community_tag: no target/object');