aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2025-02-26 16:37:38 +0100
committerMario Vavti <mario@mariovavti.com>2025-02-26 16:37:38 +0100
commit63aa50eb8d0390584743eba80e1f9bc8a912e2c5 (patch)
tree5207f7002ce3d417cc203ce77441f59698c46993
parent7fb13f23fe5e0eefbf71766dad2fc4afb5faa595 (diff)
parent65156a0e4d5c13cdc32a256daafc952222abe323 (diff)
downloadvolse-hubzilla-63aa50eb8d0390584743eba80e1f9bc8a912e2c5.tar.gz
volse-hubzilla-63aa50eb8d0390584743eba80e1f9bc8a912e2c5.tar.bz2
volse-hubzilla-63aa50eb8d0390584743eba80e1f9bc8a912e2c5.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
-rw-r--r--include/bbcode.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 15a75ce3f..65bda1b7b 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -1126,9 +1126,11 @@ function parseIdentityAwareHTML($Text) {
if ($observer) {
$s1 = '<span class="bb_observer" title="' . t('Different viewers will see this text differently') . '">';
$s2 = '</span>';
- $obsBaseURL = $observer['xchan_connurl'];
- $obsBaseURL = preg_replace("/\/poco\/.*$/", '', $obsBaseURL);
- $Text = str_replace('[observer.baseurl]', $obsBaseURL, $Text);
+
+ $parsed = parse_url($observer['xchan_url']);
+ $observer_base_url = unparse_url($parsed, ['scheme', 'host', 'port']);
+
+ $Text = str_replace('[observer.baseurl]', $observer_base_url, $Text);
$Text = str_replace('[observer.url]',$observer['xchan_url'], $Text);
$Text = str_replace('[observer.name]',$s1 . $observer['xchan_name'] . $s2, $Text);
$Text = str_replace('[observer.address]',$s1 . $observer['xchan_addr'] . $s2, $Text);
@@ -1311,9 +1313,11 @@ function bbcode($text, $options = []) {
if ($observer) {
$s1 = '<span class="bb_observer" title="' . t('Different viewers will see this text differently') . '">';
$s2 = '</span>';
- $obsBaseURL = $observer['xchan_connurl'];
- $obsBaseURL = preg_replace("/\/poco\/.*$/", '', $obsBaseURL);
- $text = str_replace('[observer.baseurl]', $obsBaseURL, $text);
+
+ $parsed = parse_url($observer['xchan_url']);
+ $observer_base_url = unparse_url($parsed, ['scheme', 'host', 'port']);
+
+ $text = str_replace('[observer.baseurl]', $observer_base_url, $text);
$text = str_replace('[observer.url]',$observer['xchan_url'], $text);
$text = str_replace('[observer.name]',$s1 . $observer['xchan_name'] . $s2, $text);
$text = str_replace('[observer.address]',$s1 . $observer['xchan_addr'] . $s2, $text);