1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 19:54:12 +02:00

[ticket/16574] Remove flash BBcode

PHPBB3-16574
This commit is contained in:
Jakub Senko
2020-10-01 10:01:47 +02:00
committed by Marc Alexander
parent d714c6db19
commit 28f98402f3
56 changed files with 115 additions and 647 deletions

View File

@@ -57,7 +57,6 @@ class factory implements \phpbb\textformatter\cache_interface
*/
protected $custom_tokens = array(
'email' => array('{DESCRIPTION}' => '{TEXT}'),
'flash' => array('{WIDTH}' => '{NUMBER1}', '{HEIGHT}' => '{NUMBER2}'),
'img' => array('{URL}' => '{IMAGEURL}'),
'list' => array('{LIST_TYPE}' => '{HASHMAP}'),
'quote' => array('{USERNAME}' => '{TEXT1}'),
@@ -79,7 +78,6 @@ class factory implements \phpbb\textformatter\cache_interface
'code' => '[CODE lang={IDENTIFIER;optional}]{TEXT}[/CODE]',
'color' => '[COLOR={COLOR}]{TEXT}[/COLOR]',
'email' => '[EMAIL={EMAIL;useContent} subject={TEXT1;optional;postFilter=rawurlencode} body={TEXT2;optional;postFilter=rawurlencode}]{TEXT}[/EMAIL]',
'flash' => '[FLASH={NUMBER1},{NUMBER2} width={NUMBER1;postFilter=#flashwidth} height={NUMBER2;postFilter=#flashheight} url={URL;useContent} /]',
'i' => '[I]{TEXT}[/I]',
'img' => '[IMG src={IMAGEURL;useContent}]',
'list' => '[LIST type={HASHMAP=1:decimal,a:lower-alpha,A:upper-alpha,i:lower-roman,I:upper-roman;optional;postFilter=#simpletext} #createChild=LI]{TEXT}[/LIST]',
@@ -268,18 +266,6 @@ class factory implements \phpbb\textformatter\cache_interface
$filter = new RegexpFilter('!^([\p{L}\p{N}\-+,_. ]+)$!Du');
$configurator->attributeFilters->add('#inttext', $filter);
// Create custom filters for Flash restrictions, which use the same values as the image
// restrictions but have their own error message
$configurator->attributeFilters
->add('#flashheight', __NAMESPACE__ . '\\parser::filter_flash_height')
->addParameterByName('max_img_height')
->addParameterByName('logger');
$configurator->attributeFilters
->add('#flashwidth', __NAMESPACE__ . '\\parser::filter_flash_width')
->addParameterByName('max_img_width')
->addParameterByName('logger');
// Create a custom filter for phpBB's per-mode font size limits
$configurator->attributeFilters
->add('#fontsize', __NAMESPACE__ . '\\parser::filter_font_size')
@@ -306,8 +292,8 @@ class factory implements \phpbb\textformatter\cache_interface
$configurator->tags['QUOTE']->nestingLimit = PHP_INT_MAX;
}
// Modify the template to disable images/flash/mentions depending on user's settings
foreach (array('FLASH', 'IMG', 'MENTION') as $name)
// Modify the template to disable images/mentions depending on user's settings
foreach (['IMG', 'MENTION'] as $name)
{
$tag = $configurator->tags[$name];
$tag->template = '<xsl:choose><xsl:when test="$S_VIEW' . $name . '">' . $tag->template . '</xsl:when><xsl:otherwise><xsl:apply-templates/></xsl:otherwise></xsl:choose>';