Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for HTML5 and custom definitions #52

Merged
merged 5 commits into from Apr 16, 2017

Conversation

LukeTowers
Copy link
Contributor

This implements the elements and attributes for HTML5 defined in https://github.com/kennberg/php-htmlpurfier-html5, and also adds support for defining a custom definition along with adding custom elements and attributes to that definition.

It is fully backwards compatible, existing configurations that don't have the new config values will still work correctly, they just won't see the new definitions until they update their configurations (which they'd need to do anyways to set new properties for the allowable).

This PR correctly implements the desired functionality that was added in #26 by @CodeL and then removed in #30 by @itbdw because it was broken when users did not update their configurations.

@mewebstudio If you are not willing to continue on with support for this project, then please let me know and I'll be happy to continue it on in my fork on the project.

@mewebstudio mewebstudio merged commit 74d915d into mewebstudio:master Apr 16, 2017
@0x5459
Copy link

0x5459 commented Nov 9, 2017

@LukeTowers
Why "video" tag still filtered?

code:
var_dump(clean('<video></video>'));
output:
string(0) ""

@LukeTowers
Copy link
Contributor Author

@ty666 I'm thinking something changed in the underlying library that may have caused issues with customizing it as is done in this PR.

@zarianec
Copy link
Contributor

zarianec commented Feb 16, 2018

It looks like HTMLPurifier_Config::inherit($config) that used when creating purifier instance (code -> code), doesn't use custom definitions from parent config object.

I'm not sure why HTMLPurifier_Config::inherit() used and is it possible to avoid using it safely.

Updated:
See #80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants