From 0bf1f9b1ad674998212a93a0ce75774a6dde7b7c Mon Sep 17 00:00:00 2001 From: Jon Stovell Date: Fri, 4 Aug 2023 11:36:34 -0600 Subject: [PATCH] Fixes uninitialized string offset error when parsing broken itemcode Fixes #7818 Signed-off-by: Jon Stovell --- Sources/Subs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Subs.php b/Sources/Subs.php index 8d62c4bb8b..2c8d9d9f13 100644 --- a/Sources/Subs.php +++ b/Sources/Subs.php @@ -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;