From 74400ea5fb347d3ecf01e3ca07f393451b119af8 Mon Sep 17 00:00:00 2001 From: Ben Coburn Date: Fri, 9 Jun 2006 09:24:34 +0200 Subject: 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 --- inc/media.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'inc') 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{ -- cgit v1.2.3