aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-10-10 18:05:26 +0000
committerMario <mario@mariovavti.com>2022-10-10 18:05:26 +0000
commitef2448e17e742e7dcef458993bce1e0a29756aa7 (patch)
treed23c62753abbb42e7bb742f2d44d09321b6f2eee /include/bbcode.php
parent6ab65519a0fc3e55ad5f32ce1641190ef609a4e2 (diff)
parent99a5cf1ad4660a31af6c03e5a1abc3d374f82c78 (diff)
downloadvolse-hubzilla-ef2448e17e742e7dcef458993bce1e0a29756aa7.tar.gz
volse-hubzilla-ef2448e17e742e7dcef458993bce1e0a29756aa7.tar.bz2
volse-hubzilla-ef2448e17e742e7dcef458993bce1e0a29756aa7.zip
Merge branch '7.8RC'7.8
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php33
1 files changed, 21 insertions, 12 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 794cb25d0..6ec24fa0b 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -367,26 +367,30 @@ function bb_format_attachdata($body) {
if($data) {
$txt = '';
- if($data['url'] && $data['title']) {
+ if(isset($data['url']) && isset($data['title'])) {
$txt .= "\n\n" . '[url=' . $data['url'] . ']' . $data['title'] . '[/url]';
}
else {
- if($data['url']) {
+ if(isset($data['url'])) {
$txt .= "\n\n" . $data['url'];
}
- if($data['title']) {
+ if(isset($data['title'])) {
$txt .= "\n\n" . $data['title'];
}
}
- if($data['preview']) {
+
+ if(isset($data['preview'])) {
$txt .= "\n\n" . '[img]' . $data['preview'] . '[/img]';
}
- if($data['image']) {
+
+ if(isset($data['image'])) {
$txt .= "\n\n" . '[img]' . $data['image'] . '[/img]';
}
+ if(isset($data['text'])) {
+ $txt .= "\n\n" . $data['text'];
+ }
- $txt .= "\n\n" . $data['text'];
return preg_replace('/\[attachment(.*?)\](.*?)\[\/attachment\]/ism',$txt,$body);
}
@@ -502,32 +506,37 @@ function bb_ShareAttributes($match) {
$author = "";
preg_match("/author='(.*?)'/ism", $attributes, $matches);
- if ($matches[1] != "")
+ if (isset($matches[1]) && $matches[1] !== '') {
$author = urldecode($matches[1]);
+ }
$link = "";
preg_match("/link='(.*?)'/ism", $attributes, $matches);
- if ($matches[1] != "")
+ if (isset($matches[1]) && $matches[1] !== '') {
$link = $matches[1];
+ }
$avatar = "";
preg_match("/avatar='(.*?)'/ism", $attributes, $matches);
- if ($matches[1] != "")
+ if (isset($matches[1]) && $matches[1] !== '') {
$avatar = $matches[1];
+ }
$profile = "";
preg_match("/profile='(.*?)'/ism", $attributes, $matches);
- if ($matches[1] != "")
+ if (isset($matches[1]) && $matches[1] !== '') {
$profile = $matches[1];
+ }
$posted = "";
preg_match("/posted='(.*?)'/ism", $attributes, $matches);
- if ($matches[1] != "")
+ if (isset($matches[1]) && $matches[1] !== '') {
$posted = $matches[1];
+ }
$auth = "";
preg_match("/auth='(.*?)'/ism", $attributes, $matches);
- if ($matches[1] != "") {
+ if (isset($matches[1]) && $matches[1] !== '') {
if($matches[1] === 'true')
$auth = true;
else