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

<?php

namespace Illuminate\Http\Middleware;

use Closure;
use Illuminate\Http\Exceptions\PostTooLargeException;

class ValidatePostSize
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     *
     * @throws \Illuminate\Http\Exceptions\PostTooLargeException
     */
    public function handle($request, Closure $next)
    {
        $max = $this->getPostMaxSize();

        if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) {
            throw new PostTooLargeException('The POST data is too large.');
        }

        return $next($request);
    }

    /**
     * Determine the server 'post_max_size' as bytes.
     *
     * @return int
     */
    protected function getPostMaxSize()
    {
        if (is_numeric($postMaxSize = ini_get('post_max_size'))) {
            return (int) $postMaxSize;
        }

        $metric = strtoupper(substr($postMaxSize, -1));

        $postMaxSize = (int) $postMaxSize;

        return match ($metric) {
            'K' => $postMaxSize * 1024,
            'M' => $postMaxSize * 1048576,
            'G' => $postMaxSize * 1073741824,
            default => $postMaxSize,
        };
    }
}

Directory Contents

Dirs: 0 × Files: 8

Name Size Perms Modified Actions
816 B lrw-rw-rw- 2025-09-17 06:53:03
Edit Download
539 B lrw-rw-rw- 2025-09-17 06:53:03
Edit Download
499 B lrw-rw-rw- 2025-09-17 06:53:03
Edit Download
2.69 KB lrw-rw-rw- 2025-09-17 06:53:03
Edit Download
2.81 KB lrw-rw-rw- 2025-09-17 06:53:03
Edit Download
3.04 KB lrw-rw-rw- 2025-09-17 06:53:03
Edit Download
5.49 KB lrw-rw-rw- 2025-09-17 06:53:03
Edit Download
1.21 KB lrw-rw-rw- 2025-09-17 06:53:03
Edit Download

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