Purifier
Purifier copied to clipboard
Allow C-ID and Base64 image tags
I need to support following img
tags:
-
<img src="cid:test.png" />
-
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..." />
Currently these img
tags are being stripped out. How can make these types of img
tags allowed?
Would like to know this as well.
In your config/purifier.php
file, you can allow more schemes with the URI.AllowedSchemes
parameter in the default settings:
'settings' => [
'default' => [
...
'URI.AllowedSchemes' => [
'http' => true,
'https' => true,
'mailto' => true,
'ftp' => true,
'nntp' => true,
'news' => true,
'data' => true,
'cid' => true,
],
...
]
]
In your config/purifier.php file, you can allow more schemes with the URI.AllowedSchemes parameter in the default settings:
I added it to newest purifier and it just does not work.
<img src="data:image/png;base64,
... is being stripped.
I wonder why this is not enabled by default, given that purifier is mostly used with WYSIWYG. Purified madness.
EDIT:
OK, here is what I noticed.
Purifier works well - both: when used as entry filter to DB and output shield on html page.
Problem arises, when you try to use to use second argument in clean(), e.g.:
clean($request->message, 'youtube')
In above case, you are getting your youtube iframe working, but
<img src="data:image/png;base64,
is being stripped.