Whielist element with class of, using htmlpurifier
Posted
by mcgrailm
on Stack Overflow
See other posts from Stack Overflow
or by mcgrailm
Published on 2010-04-15T14:38:59Z
Indexed on
2010/04/15
14:43 UTC
Read the original article
Hit count: 504
htmlpurifier
|php
I want to only allow the span element only when it has a certain class in htmlpurifier
does anyone know how to do this, right now I have
$config->set('HTML.Allowed','a[href],p,ol,li,ul,img[src],blockquote,em,span[class]');
$config->set('Attr.AllowedClasses',"allowed");
but that allows all spans and only allows class allowed I like that it only allows the "allowed" class but I only want it to allow span when the value of its class is "allowed"
thanks
© Stack Overflow or respective owner