[feature/add_events] Remove $allow_bbcode and $allow_smilies

Upon testing it was discovered that these did not work as originally intended.

PHPBB3-9550
This commit is contained in:
David King 2012-08-22 09:37:47 -04:00
parent 46597be1a3
commit 575980cba9

View file

@ -418,7 +418,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags)
return ''; return '';
} }
$censor_text = $allow_bbcode = $allow_smilies = true; $censor_text = true;
/** /**
* Use this event to modify the text before it is parsed * Use this event to modify the text before it is parsed
@ -429,11 +429,9 @@ function generate_text_for_display($text, $uid, $bitfield, $flags)
* @var string bitfield The BBCode Bitfield * @var string bitfield The BBCode Bitfield
* @var int flags The BBCode Flags * @var int flags The BBCode Flags
* @var bool censor_text Whether or not to apply word censors * @var bool censor_text Whether or not to apply word censors
* @var bool allow_bbcode Whether or not to parse BBCode
* @var bool allow_smilies Whether or not to parse Smilies
* @since 3.1-A1 * @since 3.1-A1
*/ */
$vars = array('text', 'uid', 'bitfield', 'flags', 'censor_text', 'allow_bbcode', 'allow_smilies'); $vars = array('text', 'uid', 'bitfield', 'flags', 'censor_text');
extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_before', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_before', compact($vars)));
if ($censor_text) if ($censor_text)
@ -442,7 +440,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags)
} }
// Parse bbcode if bbcode uid stored and bbcode enabled // Parse bbcode if bbcode uid stored and bbcode enabled
if ($uid && ($flags & OPTION_FLAG_BBCODE) && $allow_bbcode) if ($uid && ($flags & OPTION_FLAG_BBCODE))
{ {
if (!class_exists('bbcode')) if (!class_exists('bbcode'))
{ {
@ -463,11 +461,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags)
} }
$text = bbcode_nl2br($text); $text = bbcode_nl2br($text);
$text = smiley_text($text, !($flags & OPTION_FLAG_SMILIES));
if ($allow_smilies)
{
$text = smiley_text($text, !($flags & OPTION_FLAG_SMILIES));
}
/** /**
* Use this event to modify the text after it is parsed * Use this event to modify the text after it is parsed