diff options
author | Mario <mario@mariovavti.com> | 2020-01-30 20:06:15 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-01-30 20:06:15 +0100 |
commit | c2b6f0bc28afaaa253308bc0b90c914a08b9547b (patch) | |
tree | 112a577d708088aecabd8af957c5c40b8e24e313 /include | |
parent | 8e2446a2fc706a6750c925b4c2672314be6bb91f (diff) | |
parent | 2c42daf6090ba8d0e3a50b8350ea5a3750891b68 (diff) | |
download | volse-hubzilla-c2b6f0bc28afaaa253308bc0b90c914a08b9547b.tar.gz volse-hubzilla-c2b6f0bc28afaaa253308bc0b90c914a08b9547b.tar.bz2 volse-hubzilla-c2b6f0bc28afaaa253308bc0b90c914a08b9547b.zip |
Merge branch 'dev' into 'dev'
z6 compat work
See merge request hubzilla/core!1822
Diffstat (limited to 'include')
-rw-r--r-- | include/channel.php | 11 | ||||
-rw-r--r-- | include/text.php | 15 | ||||
-rw-r--r-- | include/zid.php | 1 |
3 files changed, 26 insertions, 1 deletions
diff --git a/include/channel.php b/include/channel.php index e7d119b1e..66ab56715 100644 --- a/include/channel.php +++ b/include/channel.php @@ -922,8 +922,17 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals $r = q("select * from pconfig where uid = %d", intval($channel_id) ); - if($r) + + if($r) { + if ($zap_compat) { + for($x = 0; $x < count($r); $x ++) { + if (preg_match('|^a:[0-9]+:{.*}$|s', $r[$x]['v'])) { + $r[$x]['v'] = serialise(unserialize($r[$x]['v'])); + } + } + } $ret['config'] = $r; + } // All other term types will be included in items, if requested. diff --git a/include/text.php b/include/text.php index 87ed9f658..1f0af08e3 100644 --- a/include/text.php +++ b/include/text.php @@ -3694,3 +3694,18 @@ function svg2bb($s) { } return EMPTY_STR; } + + + +function serialise($x) { + return ((is_array($x)) ? 'json:' . json_encode($x) : $x); +} + +function unserialise($x) { + if (is_array($x)) { + return $x; + } + $y = ((substr($x,0,5) === 'json:') ? json_decode(substr($x,5),true) : ''); + return ((is_array($y)) ? $y : $x); +} + diff --git a/include/zid.php b/include/zid.php index 3b3dd8554..325af5580 100644 --- a/include/zid.php +++ b/include/zid.php @@ -1,6 +1,7 @@ <?php use Zotlabs\Lib\Verify; +use Zotlabs\Zot\Finger; function is_matrix_url($url) { |