Fix access to potentially uninitialised offset

This commit is contained in:
Aidan Woods 2018-11-06 21:10:23 +00:00
parent c26a2ee4bf
commit 29fce0ec37
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
1 changed files with 1 additions and 1 deletions

View File

@ -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(