statamic / v2-hub

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

Fatal error when visiting `/_resources/cp` url #2468

Closed lBodia closed 4 years ago

lBodia commented 5 years ago

Describe the bug Users can see the fatal error which shows the detailed information about the system.

To Reproduce Steps to reproduce the behavior:

  1. Go to statamic_site/index.php/_resources/cp or statamic_site/_resources/cp (depending on $resources value)
  2. See error, if displaying errors isn't turned off if in php

Expected behavior 404 response is returned

Screenshots The error shows the detailed information about the system image

Environment details:

Additional context

  1. The issue is inside statamic/core/Http/ResourceServer/Server.php, in serve() and serve404Response() methods
  2. The method checks the file existence with exists which determines whether a file or directory exists
  3. In the next step is_file check fails and this leads to Exception throwing