id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses 36710 Symlinked directories should not be deleted recursively andy "When deleting a symlinked plugin, the current behavior is to recursively delete everything in the plugin's real directory and then fail to unlink the symlink because rmdir won't work on a symlink. This is probably not what the site admin intended when they installed the plugin via a symlink. The desired behavior is to unlink only the symlink, leaving the external directory intact so that other symlinks remain intact. My patch fixes this in WP_Filesystem rather than in the plugin deletion logic because it seems generally applicable to the use cases for symlinks. What makes this hard is that trailing slashes are significant when dealing with symlinked directories. The trailing slash causes the link to be followed: {{{ is_link('/link/') => false is_link('/link') => true }}} The patch fixes deletion of symlinked plugins: it unlinks the symlink and leaves the real files intact. It should be carefully checked against other uses of delete because they might not include the trailing slash. In such cases, adding a trailing slash to the new `is_dir()` check might help. Could be a minefield, could be fine. Related to #29408 but not a duplicate." defect (bug) new normal Future Release Filesystem API major has-patch needs-testing has-testing-info administration