Hi.
Thanks for the great library which saves developer lifetime 😄
I'm using this config to override the Purifier configuration in a Symfony project with the exercise/htmlpurifier-bundle
The bundle creates the parent configuration than uses HTMLPurifier_Config::inherit() method to create the child one. The method implementation is taken from the parent class, not HTML5Config as the following.
/**
* Creates a new config object that inherits from a previous one.
* @param HTMLPurifier_Config $config Configuration object to inherit from.
* @return HTMLPurifier_Config object with $config as its parent.
*/
public static function inherit(HTMLPurifier_Config $config)
{
return new HTMLPurifier_Config($config->def, $config->plist);
}
As a result all the child configurations are HTMLPurifier_Config instances instead of HTMLPurifier_HTML5Config which causes errors as they don't support HTML5 tags.
I'm using a workaround inheriting the base class like:
class HTMLPurifier_AltHTML5Config extends \HTMLPurifier_HTML5Config
{
public static function inherit(HTMLPurifier_Config $config)
{
return new static($config->def, $config->plist);
}
}
But the 'inherit()' method should be overridden as well, I suppose.
Thanks again.
Best wishes.
Hi.
Thanks for the great library which saves developer lifetime 😄
I'm using this config to override the Purifier configuration in a Symfony project with the exercise/htmlpurifier-bundle
The bundle creates the parent configuration than uses HTMLPurifier_Config::inherit() method to create the child one. The method implementation is taken from the parent class, not HTML5Config as the following.
As a result all the child configurations are HTMLPurifier_Config instances instead of HTMLPurifier_HTML5Config which causes errors as they don't support HTML5 tags.
I'm using a workaround inheriting the base class like:
But the 'inherit()' method should be overridden as well, I suppose.
Thanks again.
Best wishes.