diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 0853de31e0..97a2c92e1c 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -136,20 +136,19 @@ class acp_bbcodes if (substr($data['bbcode_tag'], -1) === '=') { - $open = '\[' . $data['bbcode_tag'] . '.*?]'; - $close = '\[/' . substr($data['bbcode_tag'], 0, -1) . ']'; + $test = substr($data['bbcode_tag'], 0, -1); } else { - $open = '\[' . $data['bbcode_tag'] . ']'; - $close = '\[/' . $data['bbcode_tag'] . ']'; + $test = $data['bbcode_tag']; } - if (!preg_match('#' . $open . '.*?' . $close . '#s', $bbcode_match)) + if (!preg_match('%\\[' . $test . '[^]]*].*?\\[/' . $test . ']%s', $bbcode_match)) { trigger_error($user->lang['BBCODE_OPEN_ENDED_TAG'] . adm_back_link($this->u_action), E_USER_WARNING); } + // @todo - bbcode_tag <= 16, bbcode_helpline <= 255, bbcode_match <= 4000 $sql_ary = array( 'bbcode_tag' => $data['bbcode_tag'], 'bbcode_match' => $bbcode_match,