aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-09-08 20:02:22 +0000
committerMario <mario@mariovavti.com>2022-09-08 20:02:22 +0000
commit990a3af2a7349e07c10224cf2a023d179ecfd6ca (patch)
tree75c6f7bcb2f7d630a3fc5395e7f3480541e4fe25 /include/bbcode.php
parent1f5a23143aa5aa1fb3273b8a9c74782cd0441fde (diff)
downloadvolse-hubzilla-990a3af2a7349e07c10224cf2a023d179ecfd6ca.tar.gz
volse-hubzilla-990a3af2a7349e07c10224cf2a023d179ecfd6ca.tar.bz2
volse-hubzilla-990a3af2a7349e07c10224cf2a023d179ecfd6ca.zip
php8: random cleanup and warning fixes
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 100991afd..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);
}