Reputation: 323
What are the appropriate ways to do HTML sanitisation and SQL sanitisation in Laravel 4?
Upvotes: 0
Views: 204
Reputation: 9843
SQL sanitisation is handled automatically. From the docs:
Note: The Laravel query builder uses PDO parameter binding throughout to protect your application against SQL injection attacks. There is no need to clean strings being passed as bindings.
Blade templates automatically escape variables when using curly brackets, e.g. {{ $var }}
. If you do not want to escape the HTML, you need to use {!! $var !!}
instead.
Upvotes: 1