You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, this still remains valid bug. I took a look myself at the code and I traced the problem to the function remove_invalid_tags() which is supposed to fix these invalid tags, but it does not.
For example, I copy/pasted your function to demonstrate the problem:
[code]
function remove_invalid_tags($str, $tags) {
foreach($tags as $tag) {
$str = preg_replace('#^</'.$tag.'>|<'.$tag.'>$#', '', trim($str));
}
return $str;
}
$html = 'test
Some time ago, I posted a bug in the output that contains invalid
tags. The bug I reported is here: CherryFramework/CherryFramework#17Unfortunately, this still remains valid bug. I took a look myself at the code and I traced the problem to the function remove_invalid_tags() which is supposed to fix these invalid tags, but it does not.
For example, I copy/pasted your function to demonstrate the problem:
';[code]
function remove_invalid_tags($str, $tags) {
foreach($tags as $tag) {
$str = preg_replace('#^</'.$tag.'>|<'.$tag.'>$#', '', trim($str));
}
return $str;
}
$html = 'test
echo "original: ".$html."\n";
echo "fixed : ".remove_invalid_tags($html, array('p'))."\n";
[/code]
The output is:
[code]
$ php -f ./test.php
original: test
fixed : test
[/code]
As you can see, the broken tag is never removed, because the regex in the preg_replace misses it.
The text was updated successfully, but these errors were encountered: