Antony
1
I have text from a summernote input field that I want to santise in my server action.
I’d like to be able to have all the HTML tags stripped except for an allowed list.
In PHP, I can do it like this:
$input = strip_tags($input, '<b><i><a>');
It looks like the Wappler strip_tags function doesn’t take any parameters to allow this… is this the case?
Would I need to write my own PHP function to do this?
Thanks!
Antony.
Teodor
2
The strip tags formatter, removes all the html tags from a string, it does not support lists of tags to be removed.
@Antony
Something like that?
Used the replace formatter n times .
n= array.length() contaning the tags that you will define…
- I used an array list because I didn’t know how to assign a static array like:
["<b>", "</b>", "<a>", "</a>", "<i>", "</i>"]
You can do that I suppose
Antony
4
I want to strip all tags except the ones in the list, so this wouldn’t work!