uri format does not accept all valid URIs
Per https://tools.ietf.org/html/rfc3986#section-1.1.2 the following should all be valid, but they're not:
[PASS] ftp://ftp.is.co.za/rfc/rfc1808.txt
[PASS] http://www.ietf.org/rfc/rfc2396.txt
[PASS] ldap://[2001:db8::7]/c=GB?objectClass?one
[PASS] mailto:[email protected]
[PASS] news:comp.infosystems.www.servers.unix
[FAIL] tel:+1-816-555-1212
[PASS] telnet://192.0.2.16:80/
[FAIL] urn:oasis:names:specification:docbook:dtd:xml:4.1.2
This is due to the usage of FILTER_VALIDATE_URL in filter_var().
just found "7://8" to be valid uri, by this validator. Don't be surprised. rfc3986 does not allow schema to start with digit, at least http://tools.ietf.org/html/rfc3986#appendix-A
I would still keep using filter_val, but report the bug to the PHP community and hope they fix filter_var. URL-testing is difficult. Also see: https://mathiasbynens.be/demo/url-regex
Also failing are protocol-relative uris, which I had previously filed as #144.
Closed with https://github.com/justinrainbow/json-schema/releases/tag/2.0.0
The relative URIs should be working but I am unsure if RFC3986 is supported per this issue. Please reopen if that is a problem with v2.0.0
Hi, the urn: related URIs are still not validated properly, it is probably an issue in PHP itself, so I've opened a ticket there as well (https://bugs.php.net/bug.php?id=81332) but until it is not fixed there, maybe this library should look out for these kind of URIs.
Okay it looks like PHP function actually validates the URL's properly, however, when the schema says it's an URI it should be validated against and URL and a URI as well, because there is some differences between the two.