Make [observer.baseurl] more reliable using connurl which will change

less often than xchan_url, which can break the regex and might not
even contain the baseurl at all, plus a bit of doco clean up.
This commit is contained in:
Thomas Willingham
2014-06-30 16:23:42 +01:00
parent f64f84b5e9
commit 7a079cd7dc
16 changed files with 23 additions and 291 deletions

View File

@@ -439,8 +439,8 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
// replace [observer.baseurl]
if ($observer) {
$obsBaseURL = $observer['xchan_url'];
$obsBaseURL = preg_replace("/\/channel\/.*$/", '', $obsBaseURL);
$obsBaseURL = $observer['xchan_connurl'];
$obsBaseURL = preg_replace("/\/poco\/.*$/", '', $obsBaseURL);
$Text = str_replace('[observer.baseurl]', $obsBaseURL, $Text);
$Text = str_replace('[observer.url]',$observer['xchan_url'], $Text);
$Text = str_replace('[observer.name]',$observer['xchan_name'], $Text);