From 044d3278188b53243d78d9de6095f2bfffdb17a2 Mon Sep 17 00:00:00 2001
From: 3D-I <480857+3D-I@users.noreply.github.com>
Date: Tue, 24 Dec 2019 21:51:00 +0100
Subject: [ticket/16267] Check whether the index exists in ACP BBcodes - PHP
 7.4

PHPBB3-16267
---
 phpBB/includes/acp/acp_bbcodes.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'phpBB/includes')

diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index 84dbbf02ba..275188c5a1 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -207,7 +207,11 @@ class acp_bbcodes
 						$db->sql_freeresult($result);
 
 						// Grab the end, interrogate the last closing tag
-						if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded) || (preg_match('#\[/([^[]*)]$#', $bbcode_match, $regs) && in_array(strtolower($regs[1]), $hard_coded)))
+						if (
+							isset($info['test']) && $info['test'] === '1'
+							|| in_array(strtolower($data['bbcode_tag']), $hard_coded)
+							|| (preg_match('#\[/([^[]*)]$#', $bbcode_match, $regs) && in_array(strtolower($regs[1]), $hard_coded))
+						)
 						{
 							trigger_error($user->lang['BBCODE_INVALID_TAG_NAME'] . adm_back_link($this->u_action), E_USER_WARNING);
 						}
-- 
cgit v1.2.1