Skip to content

Commit

Permalink
Merge pull request #7821 from Sesquipedalian/truncated_itemcode
Browse files Browse the repository at this point in the history
Fixes uninitialized string offset error when parsing broken itemcode
  • Loading branch information
jdarwood007 authored Aug 6, 2023
2 parents 8a0b818 + 0bf1f9b commit bfc48ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Subs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3482,7 +3482,7 @@ function($matches) use ($schemes)
}

// Item codes are complicated buggers... they are implicit [li]s and can make [list]s!
if ($smileys !== false && $tag === null && isset($itemcodes[$message[$pos + 1]]) && $message[$pos + 2] == ']' && !isset($disabled['list']) && !isset($disabled['li']))
if ($smileys !== false && $tag === null && isset($itemcodes[$message[$pos + 1]], $message[$pos + 2]) && $message[$pos + 2] == ']' && !isset($disabled['list']) && !isset($disabled['li']))
{
if ($message[$pos + 1] == '0' && !in_array($message[$pos - 1], array(';', ' ', "\t", "\n", '>')))
continue;
Expand Down

0 comments on commit bfc48ee

Please sign in to comment.