From 98b12b84b11c3fe488015b11e3b84bd1aaa7d719 Mon Sep 17 00:00:00 2001 From: Richard Flynn Date: Tue, 17 Jun 2025 19:36:24 -0400 Subject: [PATCH] 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`. --- Michelf/MarkdownExtra.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Michelf/MarkdownExtra.php b/Michelf/MarkdownExtra.php index c27183d..78e265d 100644 --- a/Michelf/MarkdownExtra.php +++ b/Michelf/MarkdownExtra.php @@ -499,7 +499,7 @@ class MarkdownExtra extends \Michelf\Markdown { $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; }