Merge pull request #676 from aidantwoods/fix/uninitialized-string-offset

Fix access to potentially uninitialised offset
This commit is contained in:
Aidan Woods 2018-11-06 21:49:46 +00:00 committed by GitHub
commit 2bd7113c55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1480,7 +1480,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(