Skip to content

Commit 87c2190

Browse files
committed
Fix bug when bbcode content is empty
1 parent 1dfb478 commit 87c2190

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

BbCode/Math.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ private static function loadMathjax(\XF\BbCode\Renderer\AbstractRenderer $render
1616
public static function renderMathTag($tagChildren, $tagOption, $tag,
1717
array $options, \XF\BbCode\Renderer\AbstractRenderer $renderer)
1818
{
19+
if (count($tagChildren) == 0)
20+
return '';
1921
self::loadMathjax($renderer);
2022
return '$$\[' . $tagChildren[0] . '$$\]';
2123
}
2224

2325
public static function renderInlineMathTag($tagChildren, $tagOption, $tag,
2426
array $options, \XF\BbCode\Renderer\AbstractRenderer $renderer)
2527
{
28+
if (count($tagChildren) == 0)
29+
return '';
2630
self::loadMathjax($renderer);
2731
return '$$\(' . $tagChildren[0] . '$$\)';
2832
}

0 commit comments

Comments
 (0)