Search code examples
htmlpurifier

How to whitelist IDs in HTML Purifier?


How do you whitelist particular IDs using HTML Purifier? I know how to blacklist particular IDs:

 $config->set('Attr.EnableID', true);
 $config->set('Attr.IDBlacklist' array(
'list', 'of', 'attribute', 'values', 'that', 'are', 'forbidden'

));

But I only want to add ONE type of ID, namely "ilo####" (with 1 to arbitrarily many numbers in place of ####). How do I whitelist only these particular IDs?

Thanks.


Solution

  • Unfortunately, there's no direct way to do this. Maybe you can hack around it with %Attr.IDBlacklistRegexp