Support the ongoing development of Laravel.io →
Security Views
Last updated 1 year ago.
0

Try it with two of the {{'s.

For example:

Sanitized: {{{ $var }}}

Not sanitzied: {{ $var }}

Last updated 1 year ago.
0

escaping is making sure the content doesn't get executed, so instead of an image, you see `<img ..> in plain text. That is safe. But if you want to remove all html, you can use http://php.net/strip_tags

Last updated 1 year ago.
0

@barryvdh: thanks :)

Last updated 1 year ago.
0

hi

http://laravel.io/bin/32r7

I used such code to display content (using cketditor) But it display content with html tags. Can u help me.

I tried with {{{$page->description}}} but no help

Last updated 1 year ago.
0

Here I solved it with some help from uncle Google and some good guys like us that like to share their knowledge.

{{ preg_replace('/(<.*?>)|(&.*?;)/', '', $string) }}

the

(<.*?>) 

seems to strip all the html tags pretty well.

(&.*?;) 

strips all the HTML special characters, like:

© <, > 

and other stuff

Last updated 1 year ago.
0

Try

strip_tags($string)

It will give you just plain text form string. It helped of me.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.