WP File Manager
Current Path:
/
home
/
itutorethiopia
/
public_html
/
app
/
Http
/
Middleware
/
Name
Action
..
Authenticate.php
Edit
EncryptCookies.php
Edit
RTL.php
Edit
RedirectIfAuthenticated.php
Edit
ShortcodeMiddleware.php
Edit
TrimStrings.php
Edit
TrustProxies.php
Edit
VerifyCsrfToken.php
Edit
XSS.php
Edit
bsetecAuth.php
Edit
Editing: XSS.php
<?php namespace App\Http\Middleware; use Closure; use Illuminate\Http\Request; class XSS{ protected $except_urls = [ 'core/pages/*' ]; public function handle(Request $request, Closure $next){ $regex = '#' . implode('|', $this->except_urls) . '#'; $input = $request->all(); if (!preg_match($regex, $request->path())) { array_walk_recursive($input, function(&$input) { $input = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $input); }); $request->merge($input); } return $next($request); } }