plugins/SpecialUpdownload.php
changeset 1171 d42d46e13b36
parent 1081 745200a9cc2a
child 1175 1e2c9819ede3
equal deleted inserted replaced
1170:71cb87b7dc3f 1171:d42d46e13b36
   106            
   106            
   107     $filename = $db->escape(sanitize_page_id($filename));
   107     $filename = $db->escape(sanitize_page_id($filename));
   108     $ext = substr($filename, strrpos($filename, '.'), strlen($filename));
   108     $ext = substr($filename, strrpos($filename, '.'), strlen($filename));
   109     $flen = filesize($file['tmp_name']);
   109     $flen = filesize($file['tmp_name']);
   110     
   110     
   111     $comments = ( isset($_POST['update']) ) ? $db->escape($_POST['comments']) : $db->escape(RenderMan::preprocess_text($_POST['comments'], false, false));
   111     $perms = $session->fetch_page_acl($filename, 'File');
       
   112     $comments = ( isset($_POST['update']) ) ? $db->escape($_POST['comments']) : $db->escape(RenderMan::preprocess_text($_POST['comments'], false, false, true, $perms));
   112     $chartag = sha1(microtime());
   113     $chartag = sha1(microtime());
   113     $urln = str_replace(' ', '_', $filename);
   114     $urln = str_replace(' ', '_', $filename);
   114     
   115     
   115     $key = md5($filename . '_' . ( function_exists('md5_file') ? md5_file($file['tmp_name']) : file_get_contents($file['tmp_name'])));
   116     $key = md5($filename . '_' . ( function_exists('md5_file') ? md5_file($file['tmp_name']) : file_get_contents($file['tmp_name'])));
   116     $targetname = ENANO_ROOT . '/files/' . $key . $ext;
   117     $targetname = ENANO_ROOT . '/files/' . $key . $ext;