preg_split returning false will cause TypeError on invalid countable in PHP 8
This commit is contained in:
parent
546b80a136
commit
73842d65be
1 changed files with 1 additions and 1 deletions
|
|
@ -683,7 +683,7 @@ class MarkdownExtra extends \Michelf\Markdown {
|
|||
// by the pattern.
|
||||
$parts = preg_split($tag_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE);
|
||||
|
||||
if (count($parts) < 3) {
|
||||
if ($parts === false || count($parts) < 3) {
|
||||
// End of $text reached with unbalenced tag(s).
|
||||
// In that case, we return original text unchanged and pass the
|
||||
// first character as filtered to prevent an infinite loop in the
|
||||
|
|
|
|||
Loading…
Reference in a new issue