Skip to content

Commit 67f8186

Browse files
authored
Merge pull request #14 from swisnl/bugfix/issue-13
Change directory traversal check to make sure it also works on Windows
2 parents 7dceb4f + e9e16ba commit 67f8186

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)