diff --git a/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php b/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php index 475bfac00415..d952b0c044b1 100644 --- a/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php +++ b/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php @@ -18,7 +18,9 @@ class ValidatePostSize */ public function handle($request, Closure $next) { - if ($request->server('CONTENT_LENGTH') > $this->getPostMaxSize()) { + $max = $this->getPostMaxSize(); + + if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) { throw new PostTooLargeException; }