Merge branch 'dev' of /home/macgirvin/z into dev

This commit is contained in:
nobody 2020-10-18 21:52:05 -07:00
commit 875ef56b68
3 changed files with 16 additions and 6 deletions

View file

@ -1705,9 +1705,15 @@ class Activity {
if (is_array($person_obj['icon'])) {
if (array_key_exists('url',$person_obj['icon']))
$icon = $person_obj['icon']['url'];
else
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'];
}

View file

@ -1705,10 +1705,7 @@ function bbcode($Text, $options = []) {
// crypt
if (strpos($Text,'[/crypt]') !== false) {
if ($activitypub) {
$Text = preg_replace("/\[crypt (.*?)\](.*?)\[\/crypt\]/ism", '<br><div id="' . $x . '"><img src="' .z_root() . '/images/lock_icon.svg" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br></div>', $Text);
}
else {
if (! $activitypub) {
$Text = preg_replace_callback("/\[crypt (.*?)\](.*?)\[\/crypt\]/ism", 'bb_parse_crypt', $Text);
}
}

View file

@ -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)
);
}