From 1a595f4273360087661c3b07db5d38eae6e77247 Mon Sep 17 00:00:00 2001 From: nobody Date: Sun, 18 Oct 2020 17:59:41 -0700 Subject: [PATCH 1/3] hubloc_mark_as_down() - also set site_dead --- include/hubloc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/hubloc.php b/include/hubloc.php index d25a759b1..d74541d80 100644 --- a/include/hubloc.php +++ b/include/hubloc.php @@ -247,6 +247,7 @@ function hubloc_change_primary($hubloc) { * * We use the post url to distinguish between http and https hublocs. * The https might be alive, and the http dead. + * Also set site_dead for the corresponding entry in the site table * * @param string $posturl Hubloc callback url which to disable */ @@ -255,6 +256,12 @@ function hubloc_mark_as_down($posturl) { intval(HUBLOC_OFFLINE), dbesc($posturl) ); + // extract the baseurl and set site.site_dead to match + $m = parse_url($posturl); + $h = $m['scheme'] . '://' . $m['host']; + $r = q("update site set site_dead = 1 where site_url = '%s'", + dbesc($h) + ); } From a9e8ac7f880185b61be44f84847b30ea6e01b2ab Mon Sep 17 00:00:00 2001 From: nobody Date: Sun, 18 Oct 2020 18:21:31 -0700 Subject: [PATCH 2/3] browser2browser-encryption, leave encrypted text in message for platforms lacking crypto support so they can manually decode it if they obtain the requisite tools. --- include/bbcode.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index 316ae9c79..2c8dd411a 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1705,10 +1705,7 @@ function bbcode($Text, $options = []) { // crypt if (strpos($Text,'[/crypt]') !== false) { - if ($activitypub) { - $Text = preg_replace("/\[crypt (.*?)\](.*?)\[\/crypt\]/ism", '
' . t('Encrypted content') . '
', $Text); - } - else { + if (! $activitypub) { $Text = preg_replace_callback("/\[crypt (.*?)\](.*?)\[\/crypt\]/ism", 'bb_parse_crypt', $Text); } } From f3c24172f34587182adcb721bc4a941e49340973 Mon Sep 17 00:00:00 2001 From: nobody Date: Sun, 18 Oct 2020 19:59:04 -0700 Subject: [PATCH 3/3] handle learnawesome's actor avatar - which is unexpectedly an array of HTTP urls with one element. --- Zotlabs/Lib/Activity.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 547f8508d..442d37075 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -1705,8 +1705,14 @@ class Activity { if (is_array($person_obj['icon'])) { if (array_key_exists('url',$person_obj['icon'])) $icon = $person_obj['icon']['url']; - else - $icon = $person_obj['icon'][0]['url']; + else { + if (is_string($person_obj['icon'][0])) { + $icon = $person_obj['icon'][0]; + } + elseif (array_key_exists('url',$person_obj['icon'][0])) { + $icon = $person_obj['icon'][0]['url']; + } + } } else $icon = $person_obj['icon'];