Skip to content

Commit 98b12b8

Browse files
authored
Check $parts variable for false value (#400)
This currently throws a `TypeError` if `$parts` is `false`, which is a valid return value for `preg_split`.
1 parent dbb9957 commit 98b12b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Michelf/MarkdownExtra.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
499499
$parsed .= $parts[0]; // Text before current tag.
500500

501501
// If end of $text has been reached. Stop loop.
502-
if (count($parts) < 3) {
502+
if ($parts === false || count($parts) < 3) {
503503
$text = "";
504504
break;
505505
}

0 commit comments

Comments
 (0)