diff options
author | Ben Coburn <btcoburn@silicodon.net> | 2006-06-09 09:24:34 +0200 |
---|---|---|
committer | Ben Coburn <btcoburn@silicodon.net> | 2006-06-09 09:24:34 +0200 |
commit | 74400ea5fb347d3ecf01e3ca07f393451b119af8 (patch) | |
tree | 6b09415e213389680cd15ce717caf8ef62f9f676 | |
parent | eaa525a080e385725140b65def2ba2bfa28fcc24 (diff) | |
download | rpg-74400ea5fb347d3ecf01e3ca07f393451b119af8.tar.gz rpg-74400ea5fb347d3ecf01e3ca07f393451b119af8.tar.bz2 |
fix media file permissions
Always chmod media because they may be saved with
different permissions than expected from the php umask.
darcs-hash:20060609072434-05dcb-8e6cb602df7afc75633c7eec0a9056a8b9696f77.gz
-rw-r--r-- | inc/media.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/inc/media.php b/inc/media.php index fc252a22e..e0b1f3747 100644 --- a/inc/media.php +++ b/inc/media.php @@ -220,8 +220,10 @@ function media_upload($ns,$auth){ // prepare directory io_makeFileDir($fn); if(move_uploaded_file($file['tmp_name'], $fn)) { - // set the correct permission here - if($conf['fperm']) chmod($fn, $conf['fperm']); + // Set the correct permission here. + // Always chmod media because they may be saved with different permissions than expected from the php umask. + // (Should normally chmod to $conf['fperm'] only if $conf['fperm'] is set.) + chmod($fn, $conf['fmode']); msg($lang['uploadsucc'],1); return $id; }else{ |