Skip to content

Commit e9e16ba

Browse files
committed
Change directory traversal check to make sure it also works on Windows
Fixes: #13
1 parent 7dceb4f commit e9e16ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ResponseBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ protected function getMockFilePathForRequest(RequestInterface $request, string $
171171
throw new MockNotFoundException('No fixture file found. Check possiblePaths for files that can be used.', $possiblePaths);
172172
}
173173

174-
if (realpath(\dirname($file)) !== \dirname($file)) {
174+
if (strpos(realpath($file), realpath($this->getFixturesPath())) !== 0) {
175175
throw new \RuntimeException(sprintf('Path to file "%s" is out of bounds.', $file));
176176
}
177177

0 commit comments

Comments
 (0)