Файл: vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePathEncoding.php
Строк: 34
<?php
namespace IlluminateHttpMiddleware;
use Closure;
use IlluminateHttpExceptionsMalformedUrlException;
use IlluminateHttpRequest;
class ValidatePathEncoding
{
/**
* Validate that the incoming request has a valid UTF-8 encoded path.
*
* @param IlluminateHttpRequest $request
* @param Closure $next
* @return SymfonyComponentHttpFoundationResponse
*
* @throws IlluminateHttpExceptionsMalformedUrlException
*/
public function handle(Request $request, Closure $next)
{
$decodedPath = rawurldecode($request->path());
if (! mb_check_encoding($decodedPath, 'UTF-8')) {
throw new MalformedUrlException;
}
return $next($request);
}
}