1
0
mirror of https://github.com/erusev/parsedown.git synced 2025-09-03 03:42:38 +02:00

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

View File

@@ -1480,7 +1480,7 @@ class Parsedown
protected function inlineSpecialCharacter($Excerpt) 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) and preg_match('/^&(#?+[0-9a-zA-Z]++);/', $Excerpt['text'], $matches)
) { ) {
return array( return array(