- Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
ResponseBuilder:174 will always throw an exception on Windows even if the path is valid.
if (realpath(\dirname($file)) !== \dirname($file)) { throw new \RuntimeException(sprintf('Path to file "%s" is out of bounds.', $file)); }
This is because realpath
in Windows will have backslashes as a directory separator between all directories, whereas dirname
will only have backslashes for the part that's not already in the $file
path.
realpath(\dirname($file)); // C:\dev\my-project\tests\stubs\responses\some-website.com\endpoint\123.get.mock \dirname($file); // C:\dev\my-project\tests\stubs\responses/some-website.com/endpoint/123.get.mock
Is there a reason for this specific condition instead of just file_exists()
?
if (! file_exists($file)) { throw new \RuntimeException(sprintf('Path to file "%s" is out of bounds.', $file)); }
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working