jBBCode icon indicating copy to clipboard operation
jBBCode copied to clipboard

[url] tag does not work when URL does not have a schema prefixed

Open ghost opened this issue 10 years ago • 2 comments

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.

ghost avatar Feb 01 '15 14:02 ghost

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.

23W avatar Apr 22 '15 05:04 23W

I have some code here to deal with this, but it's pretty hacky: https://github.com/r04r/Minichan/commit/0d2853443216d42df808a8d6d622930db38595ab

ghost avatar May 26 '15 14:05 ghost