25/10
2013
Wallogit.com
2017 © Pedro Peláez
A port of CodeIgniter Security Library to Laravel for XSS prevention, (*1)
Include the package in your composer file, (*2)
"require": {
"gvlatko/laravel-xss": "dev-master"
}
Run composer update, (*3)
Add the service provider in you app.php config file in the 'providers' array, (*4)
'Gvlatko\LaravelXss\LaravelXssServiceProvider'
and add the alies also in the app.php config file in the 'aliases' array, (*5)
'Xss' => 'Gvlatko\LaravelXss\LaravelXssFacade'
Use the Xss::clean($str, $is_image = FALSE) to clean user input. For example:, (*6)
$cleaned = Xss::clean(Input::get('comment');
or for use with images, (*7)
$cleaned = Xss::clean(Input::file('profile'), TRUE);