Skip to content

Commit 9c702cb

Browse files
committed
Fix the upcast handling of BBCodes that do not exist anymore
See https://www.woltlab.com/community/thread/314543/
1 parent f5fd8f7 commit 9c702cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wcfsetup/install/files/lib/system/html/upcast/node/HtmlUpcastNodeWoltlabMetacode.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function process(array $elements, AbstractHtmlNodeProcessor $htmlNodeProc
4949
$element->removeAttribute('data-attributes');
5050
}
5151
$bbcode = BBCodeCache::getInstance()->getBBCodeByTag($name);
52-
if (!$bbcode->originIsSystem) {
52+
if ($bbcode === null || !$bbcode->originIsSystem) {
5353
$nodes[] = [$element, $name, $emptyMetacodeUpcast, $attributes];
5454
continue;
5555
}
@@ -99,7 +99,7 @@ public function process(array $elements, AbstractHtmlNodeProcessor $htmlNodeProc
9999
$endParagraph = $element->ownerDocument->createElement('p');
100100
$endParagraph->append("[/{$name}]");
101101

102-
if ($bbcode->isSourceCode) {
102+
if ($bbcode?->isSourceCode) {
103103
$content = $element->ownerDocument->createElement('p');
104104
$content->append($element->textContent);
105105
DomUtil::replaceElement($element, $startParagraph, false);

0 commit comments

Comments
 (0)