Skip to content

Commit 4151738

Browse files
authored
Merge pull request #379 from sanmai/patch-1
preg_split returning false will cause TypeError on invalid countable in PHP 8
2 parents 546b80a + 73842d6 commit 4151738

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
@@ -683,7 +683,7 @@ protected function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) {
683683
// by the pattern.
684684
$parts = preg_split($tag_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE);
685685

686-
if (count($parts) < 3) {
686+
if ($parts === false || count($parts) < 3) {
687687
// End of $text reached with unbalenced tag(s).
688688
// In that case, we return original text unchanged and pass the
689689
// first character as filtered to prevent an infinite loop in the

0 commit comments

Comments
 (0)