views:

31

answers:

1

I want to allow images within my HTML Purifier filter. Unfortunately they are still being filtered. WHat is wrong with this code?

$config->set('HTML.Doctype', 'XHTML 1.0 Transitional');
$config->set('URI.DisableExternalResources', false);
$config->set('URI.DisableResources', false);
$config->set('HTML.Allowed', 'u,p,b,i,span[style],p,strong,em,li,ul,ol,div[align],br,img');

Thanks for your help.

A: 

You need to allow the src and alt attributes. HTML Purifier should probably warn you if you fail to allow a required attribute for an element/

Edward Z. Yang