function array_strip_xss($array) { $result = array(); foreach ($array as $key => $value) { $key = strip_xss($key); if (is_array($value)) { $result[$key] = array_strip_xss($value); } else { $result[$key] = strip_xss($value); } } return $result; }
<?php /* |-------------------------------------------------------------------------- | Application & Route Filters |-------------------------------------------------------------------------- | | Below you will find the "before" and "after" events for the application | which may be used to do any work before or after a request into your | application. Here you may also register your custom route filters. | */ App::before(function ($request) { Input::merge(array_strip_xss(Input::all())); }); App::after(function ($request, $response) { }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily | integrates HTTP Basic authentication for quick, simple checking. | */ Route::filter('auth', function () { if (Auth::guest()) { if (Request::ajax()) { return Response::make('Unauthorized', 401);