Skip to content

Instantly share code, notes, and snippets.

@brunoais
Created December 14, 2012 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunoais/4286536 to your computer and use it in GitHub Desktop.
Save brunoais/4286536 to your computer and use it in GitHub Desktop.
Wierd parsing of phpBB's 3.0 parser
Wiered parses:
[quote="[b]name[/b]"]text[/quote]
[quote="[i]name[/i]"]text[/quote]
[quote="[i]something[/i] [u]name[/u]"]text[/quote]
....etc...etc...
A parameter in a bbcode tag is forcibly differently written deppending on the tag itself:
[quote=name][/quote] is invalid.
[quote="name"][/quote] is valid.
and
[url=http://nourl.com]sometext[/url] is valid
[url="http://nourl.com"]sometext[/url] is invalid
A "bug" I hadn't found a ticket about
By the RFC, even though it is allowed to use the character "]", one is recommended not to use it. Anyway, so an url like:
http://somename.com/thing]/someplace/otherpath/filename
is allowed by the RFC (though recommended not to).
But with IP's, the "]" character is allowed and it's the only way if you want to specify the port, by its RFC (simplified in wikipedia).
http://en.wikipedia.org/wiki/IPv6_address#Literal_IPv6_addresses_in_network_resource_identifiers
If the tag url does not allow ip's then there should be a way to specify a link as an ip.
Another one.
By the RFC the character:
"]" is actually allowed in an e-mail. It does not mean that people uses it, but it is allowed.
With a tag like:
[email=mail]text[/email]
It's impossible to write such tag.
E.g.
[email=fancy.mail[youknowit]@someServerThatAllowsIt.com]text[/email]
Both these problems will not happen in more than 99% of the cases
Still wonder why, but not wierd:
[quote="[url=someurl]username[/url]"]text[/quote]
And makes sense as a workaround of what my new parser allows:
[quote poster="username" original="someurl"]text[/quote]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment