diff options
author | Mario <mario@mariovavti.com> | 2025-03-06 11:42:25 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2025-03-06 11:42:25 +0000 |
commit | eec918bf4ab70164cd92f84f8a7987fdcd9e0c7d (patch) | |
tree | 1a759da5ce1f0a48e5ecb50df824dbc71418e521 | |
parent | 40c63a7f1216fb95d25d1f94d7a7a5b57f7d5364 (diff) | |
download | volse-hubzilla-eec918bf4ab70164cd92f84f8a7987fdcd9e0c7d.tar.gz volse-hubzilla-eec918bf4ab70164cd92f84f8a7987fdcd9e0c7d.tar.bz2 volse-hubzilla-eec918bf4ab70164cd92f84f8a7987fdcd9e0c7d.zip |
escape tags on xchan name and cleanup baseurl/site_url variables which should be the same
-rw-r--r-- | Zotlabs/Lib/Activity.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index ae4cc02c6..1f7d4be0c 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -1718,9 +1718,9 @@ class Activity { return; } - $name = $person_obj['name'] ?? ''; + $name = ((isset($person_obj['name'])) ? escape_tags($person_obj['name']) : ''); if (!$name) { - $name = $person_obj['preferredUsername'] ?? ''; + $name = ((isset($person_obj['preferredUsername'])) ? escape_tags($person_obj['preferredUsername']) : ''); } if (!$name) { $name = t('Unknown'); @@ -1729,13 +1729,11 @@ class Activity { $webfinger_addr = ((isset($person_obj['webfinger'])) ? str_replace('acct:', '', $person_obj['webfinger']) : ''); $hostname = ''; $baseurl = ''; - $site_url = ''; $m = parse_url($url); if ($m) { - $hostname = $m['host']; - $baseurl = $m['scheme'] . '://' . $m['host'] . ((isset($m['port'])) ? ':' . $m['port'] : ''); - $site_url = $m['scheme'] . '://' . $m['host']; + $hostname = unparse_url($m, ['host']); + $baseurl = unparse_url($m, ['scheme', 'host', 'port']); } if (!$webfinger_addr && !empty($person_obj['preferredUsername']) && $hostname) { @@ -1837,7 +1835,7 @@ class Activity { q("UPDATE site SET site_update = '%s', site_dead = 0 WHERE site_url = '%s'", dbesc(datetime_convert()), - dbesc($site_url) + dbesc($baseurl) ); // update existing xchan record |