1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03: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
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

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(