From 2fbeeca132973844530d89af563d257850410b0e Mon Sep 17 00:00:00 2001 From: Joshua Dickerson Date: Fri, 4 Sep 2015 18:58:44 -0400 Subject: [PATCH] * fix disallowed tags not outputting the before/after --- Tests/OldParseBBC/ParseBBC.php | 5 +++-- Tests/Parser/Parser.php | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Tests/OldParseBBC/ParseBBC.php b/Tests/OldParseBBC/ParseBBC.php index 75e3593..2ed884f 100644 --- a/Tests/OldParseBBC/ParseBBC.php +++ b/Tests/OldParseBBC/ParseBBC.php @@ -990,8 +990,9 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra { if (!isset($possible['disallow_before'], $possible['disallow_after'])) continue; - $possible['before'] = isset($possible['disallow_before']) ? $tag['disallow_before'] : $possible['before']; - $possible['after'] = isset($possible['disallow_after']) ? $tag['disallow_after'] : $possible['after']; + + $possible['before'] = isset($possible['disallow_before']) ? $possible['disallow_before'] : $possible['before']; + $possible['after'] = isset($possible['disallow_after']) ? $possible['disallow_after'] : $possible['after']; } $pos1 = $pos + 1 + $pt_strlen + 1; diff --git a/Tests/Parser/Parser.php b/Tests/Parser/Parser.php index 7a7d762..9eb66c7 100644 --- a/Tests/Parser/Parser.php +++ b/Tests/Parser/Parser.php @@ -573,7 +573,7 @@ protected function alternateQuoteStyle(&$tag) $tag[Codes::ATTR_BEFORE] = str_replace('
', '
', $tag[Codes::ATTR_BEFORE]); } - protected function checkCodeAttributes($next_c, array &$possible, $tag) + protected function checkCodeAttributes($next_c, array $possible) { // Do we want parameters? if (!empty($possible[Codes::ATTR_PARAM])) @@ -644,8 +644,8 @@ protected function checkCodeAttributes($next_c, array &$possible, $tag) } // @todo this isset() is never true. Not sure what $tag does here. If we remove this, remove the & from the function parameters and the $tag as well - $possible[Codes::ATTR_BEFORE] = isset($possible[Codes::ATTR_DISALLOW_BEFORE]) ? $tag[Codes::ATTR_DISALLOW_BEFORE] : $possible[Codes::ATTR_BEFORE]; - $possible[Codes::ATTR_AFTER] = isset($possible[Codes::ATTR_DISALLOW_AFTER]) ? $tag[Codes::ATTR_DISALLOW_AFTER] : $possible[Codes::ATTR_AFTER]; + $possible[Codes::ATTR_BEFORE] = isset($possible[Codes::ATTR_DISALLOW_BEFORE]) ? $possible[Codes::ATTR_DISALLOW_BEFORE] : $possible[Codes::ATTR_BEFORE]; + $possible[Codes::ATTR_AFTER] = isset($possible[Codes::ATTR_DISALLOW_AFTER]) ? $possible[Codes::ATTR_DISALLOW_AFTER] : $possible[Codes::ATTR_AFTER]; } $this->pos1 = $this->pos + 1 + $possible[Codes::ATTR_LENGTH] + 1;