diff options
author | andi <andi@splitbrain.org> | 2005-05-01 15:20:42 +0200 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-05-01 15:20:42 +0200 |
commit | 43dd051e45ee9e8f4ef8149d7f7baf9ccea0d1e6 (patch) | |
tree | f0c889d5ff5481d2339a6ab070ce7c97ceacd40c | |
parent | 265e3787e12edf6f10be9d7260d20ea1778428cb (diff) | |
download | rpg-43dd051e45ee9e8f4ef8149d7f7baf9ccea0d1e6.tar.gz rpg-43dd051e45ee9e8f4ef8149d7f7baf9ccea0d1e6.tar.bz2 |
fix for uploaded media permissions
darcs-hash:20050501132042-9977f-2ffb1d14c062dae92c1d491e99591698200f0b5b.gz
-rw-r--r-- | media.php | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -45,6 +45,7 @@ function media_upload($NS){ require_once(DOKU_INC.'inc/confutils.php'); global $lang; + global $conf; // get file $id = $_POST['id']; @@ -60,12 +61,15 @@ function media_upload($NS){ $types = array_map(create_function('$q','return preg_quote($q,"/");'),$types); $regex = join('|',$types); - + // we set the umask here but this doesn't really help + // because a temp file was created already umask($conf['umask']); if(preg_match('/\.('.$regex.')$/i',$fn)){ // prepare directory io_makeFileDir($fn); if (move_uploaded_file($file['tmp_name'], $fn)) { + // set the correct permission here + chmod($fn, 0777 - $conf['umask']); msg($lang['uploadsucc'],1); return true; }else{ |