statamic / v2-hub

Statamic 2 - Feature Requests and Bug Reports
https://statamic.com
95 stars 5 forks source link

POST request in CP that exceeds post_max_size is reported as TokenMismatchException #1550

Open travisulrich opened 7 years ago

travisulrich commented 7 years ago

Expected behaviour

When uploading a file in the control panel that exceeds post_max_size, the resulting error message should explain that the file is too large (similar to error when upload_max_filesize is exceeded

Actual behaviour

After file uploads completely, simple "Unauthorized" message is shown in the the CP. When looking at the web console, actual response indicates TokenMismatchException with redirect URL to login page.

Steps to reproduce

  1. In the CP, upload an asset smaller than upload_max_filesize yet larger than post_max_size
  2. See "unauthorized" message

Server Details

Operating System: Ubuntu 16.04.1

Web Server: nginx

PHP Version: 7.1 (updated via Laravel forge from 7.0)

Statamic Version: 2.6.3 Updated from an older Statamic or fresh install: updated

Logs

TokenMismatchException is no longer logged

jasonvarga commented 7 years ago

Good find. This has been addressed in Laravel 5.4. We can probably backport their fix.