PHP 8.3.31
Preview: TransformsRequest.php Size: 2.05 KB
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php

<?php

namespace Illuminate\Foundation\Http\Middleware;

use Closure;
use Symfony\Component\HttpFoundation\ParameterBag;

class TransformsRequest
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $this->clean($request);

        return $next($request);
    }

    /**
     * Clean the request's data.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return void
     */
    protected function clean($request)
    {
        $this->cleanParameterBag($request->query);

        if ($request->isJson()) {
            $this->cleanParameterBag($request->json());
        } elseif ($request->request !== $request->query) {
            $this->cleanParameterBag($request->request);
        }
    }

    /**
     * Clean the data in the parameter bag.
     *
     * @param  \Symfony\Component\HttpFoundation\ParameterBag  $bag
     * @return void
     */
    protected function cleanParameterBag(ParameterBag $bag)
    {
        $bag->replace($this->cleanArray($bag->all()));
    }

    /**
     * Clean the data in the given array.
     *
     * @param  array  $data
     * @param  string  $keyPrefix
     * @return array
     */
    protected function cleanArray(array $data, $keyPrefix = '')
    {
        foreach ($data as $key => $value) {
            $data[$key] = $this->cleanValue($keyPrefix.$key, $value);
        }

        return $data;
    }

    /**
     * Clean the given value.
     *
     * @param  string  $key
     * @param  mixed  $value
     * @return mixed
     */
    protected function cleanValue($key, $value)
    {
        if (is_array($value)) {
            return $this->cleanArray($value, $key.'.');
        }

        return $this->transform($key, $value);
    }

    /**
     * Transform the given value.
     *
     * @param  string  $key
     * @param  mixed  $value
     * @return mixed
     */
    protected function transform($key, $value)
    {
        return $value;
    }
}

Directory Contents

Dirs: 1 × Files: 10

Name Size Perms Modified Actions
Concerns DIR
- drwxrwxrwx 2025-09-17 06:52:56
Edit Download
139 B lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
1.34 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
2.39 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
1.02 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
4.87 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
2.05 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
2.53 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
169 B lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
174 B lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
6.36 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).