mansj / enable-media-replace

***DEVELOPMENT DISCONTINUED*** Enable Media Replace, a WordPress plugin to make it possible to replace uploaded media files in a simple way.
GNU General Public License v2.0
28 stars 27 forks source link

is_writable check isn't right #25

Open harris1 opened 7 years ago

harris1 commented 7 years ago

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!

mansj commented 7 years ago

Thank you, I'll look at this now.