mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-22 05:35:15 +00:00
Merge branch 'dev' of /home/macgirvin/z into dev
This commit is contained in:
commit
875ef56b68
3 changed files with 16 additions and 6 deletions
|
@ -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'];
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue