Page MenuHomePhabricator

validateRegistrationFile.php fails on protocol-relative URLs
Closed, ResolvedPublic

Description

Per https://gerrit.wikimedia.org/r/194026, I tried to validate the file included there, but was rebuffed.

I assume this is because the URL starts with "//" which is valid URL syntax.

plz to be fixing.

Filed upstream at https://github.com/justinrainbow/json-schema/issues/144.

Event Timeline

MarkTraceur assigned this task to Legoktm.
MarkTraceur raised the priority of this task from to Needs Triage.
MarkTraceur updated the task description. (Show Details)
MarkTraceur added a project: MediaWiki-General.
MarkTraceur added a subscriber: MarkTraceur.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 17 2015, 8:44 PM
Legoktm set Security to None.

Alright so...we validate "url" against the "uri" format. According to http://json-schema.org/latest/json-schema-validation.html#anchor123 it just obeys RFC 3986. I skimmed through http://tools.ietf.org/html/rfc3986 and it appears that protocol relative urls are not valid. So two options:

  • Don't use a protocol relative url
  • Change the schema so it accepts protocol-relative urls (likely with a regex or something).

I skimmed through http://tools.ietf.org/html/rfc3986 and it appears that protocol relative urls are not valid. So two options:

On IRC I was corrected, and they are in fact valid. https://tools.ietf.org/html/rfc3986#section-4.2 says "rarely used", which is just outdated. I'll file an upstream bug

Legoktm removed Legoktm as the assignee of this task.Apr 6 2015, 6:47 PM
Legoktm updated the task description. (Show Details)
Legoktm added a project: Upstream.
Legoktm moved this task from Backlog to Reported Upstream on the Upstream board.
Krenair added a subscriber: Krenair.Apr 6 2015, 6:51 PM

Upstream bug is fixed - are we at an updated enough version that this can be resolved now?

Upstream bug is fixed - are we at an updated enough version that this can be resolved now?

https://en.wikipedia.org/wiki/Special:Version says we're on 5.2.0.
If I interpret https://github.com/justinrainbow/json-schema/tree/5.x.x correctly this task can be closed as resolved?

Change 365655 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/core@master] registration: Allow protocol-relative links in "url" field

https://gerrit.wikimedia.org/r/365655

Change 365655 merged by jenkins-bot:
[mediawiki/core@master] registration: Allow protocol-relative links in "url" field

https://gerrit.wikimedia.org/r/365655

Legoktm closed this task as Resolved.Jul 17 2017, 5:31 PM
Legoktm claimed this task.