Skip to content

Commit

Permalink
* fix disallowed tags not outputting the before/after
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaadickerson committed Sep 4, 2015
1 parent 22658bf commit 2fbeeca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Tests/OldParseBBC/ParseBBC.php
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions Tests/Parser/Parser.php
Expand Up @@ -573,7 +573,7 @@ protected function alternateQuoteStyle(&$tag)
$tag[Codes::ATTR_BEFORE] = str_replace('<blockquote>', '<blockquote class="bbc_' . ($quote_alt ? 'alternate' : 'standard') . '_quote">', $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]))
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2fbeeca

Please sign in to comment.