Avoid undefined variable "$rendered"

This commit is contained in:
Michael 2022-12-31 16:47:33 +00:00
parent 319857edaa
commit e0a5e32f8e

View file

@ -3449,13 +3449,15 @@ class Item
} }
// @todo Use a template // @todo Use a template
$preview_mode = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'preview_mode', BBCode::PREVIEW_LARGE); $preview_mode = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'preview_mode', BBCode::PREVIEW_LARGE);
if ($preview_mode != BBCode::PREVIEW_NONE) { if ($preview_mode != BBCode::PREVIEW_NONE) {
$rendered = BBCode::convertAttachment('', BBCode::INTERNAL, false, $data, $uriid, $preview_mode); $rendered = BBCode::convertAttachment('', BBCode::INTERNAL, false, $data, $uriid, $preview_mode);
} else {
$rendered = '';
} }
} elseif (!self::containsLink($content, $data['url'], Post\Media::HTML)) { } elseif (!self::containsLink($content, $data['url'], Post\Media::HTML)) {
$rendered = Renderer::replaceMacros(Renderer::getMarkupTemplate('content/link.tpl'), [ $rendered = Renderer::replaceMacros(Renderer::getMarkupTemplate('content/link.tpl'), [
'$url' => $data['url'], '$url' => $data['url'],
'$title' => $data['title'], '$title' => $data['title'],
]); ]);
} else { } else {