Skip to content

Conversation

@parhuzamos
Copy link

@parhuzamos parhuzamos commented Jan 12, 2021

Q A
Bug fix? yes
New feature? no

As symlinks are special files in the zip, symlinks to directories must be treated like files and must loose their directory attribute. Those zip entries may not have / as a suffix in their name, as ZipEntry->setName() would mark them as a directory.

Note that PHP treats symlinks as files, so FilesUtil::removeDir() had to be modified too for the test to pass.

$ php -r 'chdir(exec("mktemp -d")); mkdir("one"); symlink("./one", "symlinked"); rmdir("one"); rmdir("symlinked"); unlink("symlinked");'

Produces: PHP Warning: rmdir(symlinked): Not a directory in Command line code on line 1
But unlink() succeeds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant