From 990a3af2a7349e07c10224cf2a023d179ecfd6ca Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 8 Sep 2022 20:02:22 +0000 Subject: php8: random cleanup and warning fixes --- include/bbcode.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'include/bbcode.php') 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); } -- cgit v1.2.3