summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2018-01-08 17:40:37 +0100
committerYorhel <git@yorhel.nl>2018-01-08 17:40:47 +0100
commit5d11dad2ab83429eb68553e2b970f7509cc61473 (patch)
treeb96990ec008b93d6227c2eb822f4cc2d1e10850f /util
parent782adc08cd0a1711af13239f0b10f77177354b58 (diff)
BBCode: Fix parsing of tags in [something[url=..]
https://vndb.org/t2520.233 The old bb2html() blindly replaced [url=..] anywhere inside the matched token, and did not require that the [url=..] was itself the token. I've made the tag matching more strict to make sure that [something[url=..] is now properly tokenized. This also affects other tags, so it's likely that there's some input that the old bb2html() would still have handled differently.
Diffstat (limited to 'util')
-rwxr-xr-xutil/bbcode-test.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/util/bbcode-test.pl b/util/bbcode-test.pl
index 07133aca..ba39fb13 100755
--- a/util/bbcode-test.pl
+++ b/util/bbcode-test.pl
@@ -109,10 +109,10 @@ my @tests = (
'<a href="/v17">v17</a> text dds16v21 more text1 <a href="/v9">v9</a>',
'v17 text dds16v21 more text1 v9',
- # https://vndb.org/t2520.231
- 'pov1',
- 'pov1',
- 'pov1',
+ # https://vndb.org/t2520.233
+ '[From[url=http://densetsu.com/display.php?id=468&style=alphabetical] Anime Densetsu[/url]]',
+ '[From<a href="http://densetsu.com/display.php?id=468&amp;style=alphabetical" rel="nofollow"> Anime Densetsu</a>]',
+ '[From Anime Densetsu]',
# Not sure what to do here
#'http://some[raw].pointlessly[/raw].unusual.domain/',
@@ -166,6 +166,8 @@ my @invalid_syntax = (
'[url=nicetext]simpler invalid param[/url]',
'[url]empty "url" tag[/url]',
'[tag]custom tag[/tag]',
+ # https://vndb.org/t2520.231
+ 'pov1',
);