ezyang / htmlpurifier

Standards compliant HTML filter written in PHP
http://htmlpurifier.org
GNU Lesser General Public License v2.1
3.02k stars 323 forks source link

URI schemas with dashes #378

Open tapsavo opened 1 year ago

tapsavo commented 1 year ago

Having a bit of issues with htmlpurifier when it comes to links with the schemapart containing a dash, eg: "foo-bar://something/something-the-local-computer-handles-when-clicked"

This would be fairly straightforward with the URI.AllowedSchemes and writing a class for it, but a class with a dash in it's name isn't allowed in PHP. eg. in this case "HTMLPurifier_URIScheme_foo-bar".

As far as I'm aware, "+", "-"... etc are allowed by the rfc2396.

pyres01 commented 1 year ago

邮件已收到,谢谢!

ezyang commented 1 year ago

bloop. Someone should write a patch to normalize the schemes to be valid class name