Welcome! » Log In » Create A New Profile

Adding b64 images support to the default whitelist

Posted by Sander 


I would like to add b64 images support to the default whitelist.


$config->set('URI.AllowedSchemes', array('data' => true));

makes htmlpurifier let the images through, but it resets the entire default whitelist.

So, my question is, is it possible to add this setting to the default whitelist ?

Re: Adding b64 images support to the default whitelist
May 18, 2018 04:09PM

Yeah, this is a wart in the config object interface. The easiest thing to do is copy paste in the default and add the piece you want.

Your Email:


HTML input is enabled. Make sure you escape all HTML and angled brackets with < and >.

Auto-paragraphing is enabled. Double newlines will be converted to paragraphs; for single newlines, use the pre tag.

Allowed tags: a, abbr, acronym, b, blockquote, caption, cite, code, dd, del, dfn, div, dl, dt, em, i, ins, kbd, li, ol, p, pre, s, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var.

For inputting literal code such as HTML and PHP for display, use CDATA tags to auto-escape your angled brackets, and pre to preserve newlines:

Place code here

Power users, you can hide this notice with:

.htmlpurifier-help {display:none;}