Skip to content

Commit

Permalink
Update XSS.php
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Feb 2, 2022
1 parent 05d55f2 commit 957d307
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/MicroweberPackages/App/Http/Middleware/XSS.php
Expand Up @@ -5,21 +5,24 @@
use Closure;
use Illuminate\Http\Request;
use GrahamCampbell\SecurityCore\Security;
use MicroweberPackages\Helper\HTMLClean;

class XSS
{
public function handle(Request $request, Closure $next)
{
$input = $request->all();

array_walk_recursive($input, function (&$input) {
$clean = new HTMLClean();

array_walk_recursive($input, function (&$input) use ($clean) {
if (is_string($input)) {
$input = Security::create()->clean($input);
$input = $clean->clean($input);
}
});

$request->merge($input);
return $next($request);
}

}
}

0 comments on commit 957d307

Please sign in to comment.