Merge pull request #12584 from annando/avoid-undefined

Avoid undefined variable "$rendered"
This commit is contained in:
Hypolite Petovan 2022-12-31 11:55:45 -05:00 committed by GitHub
commit 7942881f7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3449,13 +3449,15 @@ class Item
}
// @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) {
$rendered = BBCode::convertAttachment('', BBCode::INTERNAL, false, $data, $uriid, $preview_mode);
} else {
$rendered = '';
}
} elseif (!self::containsLink($content, $data['url'], Post\Media::HTML)) {
$rendered = Renderer::replaceMacros(Renderer::getMarkupTemplate('content/link.tpl'), [
'$url' => $data['url'],
'$url' => $data['url'],
'$title' => $data['title'],
]);
} else {