Page MenuHomePhabricator

Try harder to validate link protocols in tokenizer, and support $wgUrlProtocols
Closed, ResolvedPublic

Description

In the absence of templates, the target of external links can be validated right in the tokenizer. This would improve our wikitext escaping, as this also uses the tokenizer to identify problematic syntax.

We currently use a hard-coded list of protocols equivalent to the default value of $wgUrlProtocols. Ideally we would get the list of configured protocols through the API when constructing WikiConfig. It is not clear if $wgUrlProtocols is currently available. If it is not, we could probably expose the value of wfUrlProtocols as an API string.


Version: unspecified
Severity: normal

Details

Reference
bz44449

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:19 AM
bzimport set Reference to bz44449.

MarkTraceur uploaded Gerrit change 49179 for the core part of this.

https://gerrit.wikimedia.org/r/49190 added URL validation in the tokenizer based on the wiki's configured URL protocols. Closing as fixed.