jBBCode
jBBCode copied to clipboard
[url] tag does not work when URL does not have a schema prefixed
When using the DefaultCodeDefinitionSet the following does not work: [url=www.google.com]www.google.com[/url]
. This is not unreasonable since it is technically not a valid URL, however most users will expect this to work. It may be fruitful to include a mechanism where it can default to the http:// schema when none is found.
This issue has been raised on behalf of https://github.com/r04r/Minichan/issues/21.
Same error with img tag. UrlValidator is very strong, it works with filter_var($input, FILTER_VALIDATE_URL) and do not pass relative URLs and URLs without scheme. May be parse_url() is better way for URL validation.
I have some code here to deal with this, but it's pretty hacky: https://github.com/r04r/Minichan/commit/0d2853443216d42df808a8d6d622930db38595ab