laravel / folio

Page based routing for Laravel.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

On Windows Laravel Folio throws always a PossibleDirectoryTraversal Exception

fabiosozzi opened this issue · comments

Folio Version

v1.0.0-beta.1

Laravel Version

v10.16.1

PHP Version

8.1.10

Description

I'm using Laravel with Laragon on Windows, every time I try to load some blade file in the default Folio folder ('/view/pages') Laravel throws a PossibleDirectoryTraversal Exception.

Looking in the sources of the package, the problem seems located in vendor/laravel/folio/src/Pipeline/EnsureNoDirectoryTraversal.php at row 22:

if (! Str::of(realpath($view->path))->startsWith($state->mountPath.'/')) { throw new PossibleDirectoryTraversal; }

Using dd() the result of realpath($view->path) has a different ending char than $state->mountPath.'/'

realpath($view->path) => C:\laragon\www\filamentv3\resources\views\pages\index.blade.php"
$state->mountPath.'/' => "C:\laragon\www\filamentv3\resources\views\pages/"

Steps To Reproduce

  1. Install Laravel Folio
  2. Delete default route
  3. Create a page with php artisan make:folio index
  4. Try to load the the folio route with the browser

We have this solved already. It'll be in the next beta. Thanks!

Sorry, I did not see that it was already solved.
Thank you for your great job!