[ticket/16880] Enable all BBCodes during reparsing

PHPBB3-16880
This commit is contained in:
JoshyPHP 2021-09-19 19:03:39 +02:00
parent 2a1656e7b3
commit f68079cfc7

View file

@ -76,20 +76,16 @@ abstract class base implements reparser_interface
}
// Those BBCodes are disabled based on context and user permissions and that value is never
// stored in the database. Here we test whether they were used in the original text.
$bbcodes = array('flash', 'img', 'quote', 'url');
foreach ($bbcodes as $bbcode)
{
$field_name = 'enable_' . $bbcode . '_bbcode';
$record[$field_name] = $this->guess_bbcode($record, $bbcode);
}
// Magic URLs are tied to the URL BBCode, that's why if magic URLs are enabled we make sure
// that the URL BBCode is also enabled
if ($record['enable_magic_url'])
{
$record['enable_url_bbcode'] = true;
}
// stored in the database. However, when a user attempts to post a message that contains an
// unauthorized BBCode, the message is rejected. Therefore, messages found in the database
// should not contain any unauthorized BBCodes, which means it should be safe to enable all
// of them in bulk if they are not explicitly disabled in the record.
$record += [
'enable_flash_bbcode' => true,
'enable_img_bbcode' => true,
'enable_quote_bbcode' => true,
'enable_url_bbcode' => true,
];
return $record;
}