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

Set file permissions of new file = old file #7

Closed fiwad closed 10 years ago

fiwad commented 10 years ago

File permissions for the new file are set to the same value as for the old file and no longer to 644.

As a result there is no chance that the plugin influences the security concept of the web server. For example, on my web server any files that are uploaded with WordPress automatically get the right permissions which are '660'. Some time before I noticed that there was a handful of files that had '644', but: Why?. It took me quite a while to find out that those files were uploaded with Enable Media Replace.

With this change the file permissions are remaining untouched, the plugin 'only' does what it should do: Replacing a file.

fiwad commented 10 years ago

Dear mansj,

I thought I could start two independent pull requests after another. But this doesn't seem to be possible. GIT added my suggested changes to popup.php to the pull request regarding file permissions. Sorry for that. But I guess you can use both anyway.

BTW: I've used the online editor and I only added the text domain in line 63 of popup.php. I don't know what has happened to lines 5 and 6.

I haven't changed the language files _enable-media-replace-deDE.po/mo to add my suggested German sentence ('Bitte beachten Sie, dass beim Hochladen eines neuen Bildes lediglich Einbettungen/Links des originalen Bildes in Ihren Beiträgen ersetzt werden.' for 'Please note that if you upload a new image...') because it seems to me that you're using Poedit. I don't and therefore I didn't want to take the risk of disarranging your language files.

(I use another tool because I've had the impression that Poedit doesn't translate header descriptions (the sentence which is displayed in WordPress' Plugins admin screen). The concept of translating header descriptions is very easy and described here in section Headers. To me the plugin Codestyling Localization is superiour.)

Most important to me is the file permissions suggestion and I'd greatly appreciate if you could merge it in the next version of Enable Media Replace. Thanks a lot.

Regards, fiwad

mansj commented 10 years ago

Thanks, this is a good idea! I will incorporate this in my next release.