[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 // 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. // stored in the database. However, when a user attempts to post a message that contains an
$bbcodes = array('flash', 'img', 'quote', 'url'); // unauthorized BBCode, the message is rejected. Therefore, messages found in the database
foreach ($bbcodes as $bbcode) // 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.
$field_name = 'enable_' . $bbcode . '_bbcode'; $record += [
$record[$field_name] = $this->guess_bbcode($record, $bbcode); 'enable_flash_bbcode' => true,
} 'enable_img_bbcode' => true,
'enable_quote_bbcode' => true,
// Magic URLs are tied to the URL BBCode, that's why if magic URLs are enabled we make sure 'enable_url_bbcode' => true,
// that the URL BBCode is also enabled ];
if ($record['enable_magic_url'])
{
$record['enable_url_bbcode'] = true;
}
return $record; return $record;
} }