file_exists()
returns false
for symlinks with missing targets
#346
Labels
bug
Something isn't working
Projects
Background
If a symlink is passed and its target does not exist, PHP's
file_exists
function will returnfalse
regardless of whether the symlink itself exists at the given path or not.The Issue
Currently we short-circuit when PHP claims the "file" doesn't exist:
servidor/app/FileManager/FileManager.php
Lines 130 to 143 in 2d87479
...meaning if we attempt to delete a symlink and its target has already been removed, it's not possible to remove the symlink without first pointing it to a file that exists (or creating the file it references).
We'll need another test (see below), but it may be necessary to check
is_link()
first so that special treatment can be given.Theoretical Test
The text was updated successfully, but these errors were encountered: