From 6f45e132134f2c8822bfc52ea54bc97e36866dd6 Mon Sep 17 00:00:00 2001 From: Richard Flynn Date: Thu, 6 Jun 2024 11:34:47 -0400 Subject: [PATCH] Check $parts variable for `false` value This currently throws a `TypeError` if `$parts` is `false`, which is a valid return value for `preg_split`. --- Michelf/MarkdownExtra.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Michelf/MarkdownExtra.php b/Michelf/MarkdownExtra.php index f814cde..9a54551 100644 --- a/Michelf/MarkdownExtra.php +++ b/Michelf/MarkdownExtra.php @@ -499,7 +499,7 @@ protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0, $parsed .= $parts[0]; // Text before current tag. // If end of $text has been reached. Stop loop. - if (count($parts) < 3) { + if ($parts === false || count($parts) < 3) { $text = ""; break; }