I know that laravel's e() function will sanitize any input passed it ex : e($Input); , this will sanitize whatever the $Input string is.
Now how can i whitelisting some html entities with e() function in laravel 4? Is that possible?
Let's say i want to whitelist the <img> tag so everything will be filtered except the <img> tag.
Thanks.
You can't. If you want to allow html, use http://www.php.net/strip_tags
I understand that using strip_tags will allow me to pass in second parameter so i can whitelisting some html entities but will it by default (without passing any whitelisting parameter) sanitize everything just like e() ?
Strip_tags strips the tags, htmlentities converts the html tags, so you can read the tags, but they aren't parsed as HTML. So they are not the same.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community