Topic: parser.php - tags, that musn't be closed.
I tried to add to bbcode some new tags, which don't have closing element. I added name of tag to array $tags_open and not to $tags_closed, but parser keep telling me, that I haven't closed my new tag during validation.
I suggest to change this fragment of code in parser.php:
@@ -480,13 +486,16 @@
}
if (in_array($current_tag, array_keys($tags_limit_bbcode)))
$limit_bbcode = $tags_limit_bbcode[$current_tag];
- $open_tags[] = $current_tag;
- $open_args[] = $current_arg;
- $opened_tag++;
+ // add open_tags to stack only if they must be closed.
+ if (!in_array($current_tag, $tags_opened) || in_array($current_tag, $tags_closed)) {
+ $open_tags[] = $current_tag;
+ $open_args[] = $current_arg;
+ $opened_tag++;
+ }
$new_text .= $current;
continue;
}
}
This did the trick for me.
I know that arrays $tags_open and $tags_closed are equal, but now it is hard to make an extension, which adds non-closing tags into bbcode.
<?php $t='<?php $t=%c%s%c; printf($t,39,$t,39,10);%c'; printf($t,39,$t,39,10);