enable-media-replace icon indicating copy to clipboard operation
enable-media-replace copied to clipboard

is_writable check isn't right

Open harris1 opened this issue 8 years ago • 1 comments

Hello and thank you for Enable Media Replace,

I have an hopefully easy to fix issue. In upload.php, is_writable($current_file) should be is_writable(dirname($current_file)). unlink requires write access on the directory and doesn't even look at the file permissions.

A few sites have complicated permissions where the web-server doesn't have write access to the attachment files, but can remove them and add new attachments.

Thanks!

harris1 avatar Apr 17 '17 17:04 harris1

Thank you, I'll look at this now.

mansj avatar Jul 21 '17 11:07 mansj