Open chris5560 opened 1 year ago
This would not only affect WebDAV, but at least also InMemory, StaticInMemory and ZipArchive.
Example test:
/**
* @test
*
* @dataProvider directoryPrefixProvider
*/
public function ensure_prefixed_directories_are_created_issue_1689(string $path): void
{
$this->runScenario(function () use ($path) {
$adapter = $this->adapter();
$adapter->createDirectory(
$path.'test',
new Config()
);
$this->assertTrue($adapter->directoryExists('test'));
});
}
public static function directoryPrefixProvider(): iterable
{
yield [ './'];
yield [ '/'];
yield [ '/./'];
}
And what about creating a file ./my_fily.txt
. This results into errors, too.
If you think it's worth, feel free to create a PR to fix it.
In "WebDAVAdapter.php" file, the function "createDirectory" does not work, if a directory specified for "$path" starts with a "." or "/". The function will "return" directly. Line 219 says "return" it must be "continue" and everything works fine. Please fix it. Thanks Christian