From 29fce0ec3776e9ba61414fa53a8fc4ecbf742aeb Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Tue, 6 Nov 2018 21:10:23 +0000 Subject: [PATCH] Fix access to potentially uninitialised offset --- Parsedown.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parsedown.php b/Parsedown.php index 9008a89..91e63a7 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -1476,7 +1476,7 @@ class Parsedown protected function inlineSpecialCharacter($Excerpt) { - if ($Excerpt['text'][1] !== ' ' and strpos($Excerpt['text'], ';') !== false + if (substr($Excerpt['text'], 1, 1) !== ' ' and strpos($Excerpt['text'], ';') !== false and preg_match('/^&(#?+[0-9a-zA-Z]++);/', $Excerpt['text'], $matches) ) { return array(