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

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

View File

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