Changeset 2376 in subversion


Ignore:
Timestamp:
Apr 6, 2009 7:33:13 AM (4 years ago)
Author:
alec
Message:
  • Fix 'temp_dir' does not support relative path under Windows (#1484529)
  • add file_exists check for uploaded attachments
Location:
trunk/roundcubemail
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r2375 r2376  
    22=========================== 
    33 
     4- Fix 'temp_dir' does not support relative path under Windows (#1484529) 
    45- Fix "Initialize Database" button missing from installer (#1485802) 
    56- Fix compose window doesn't fit 1024x768 window (#1485396) 
  • trunk/roundcubemail/program/steps/mail/attachments.inc

    r2313 r2376  
    6464$temp_dir = unslashify($CONFIG['temp_dir']); 
    6565 
     66// #1484529: we need absolute path on Windows for move_uploaded_file() 
     67if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { 
     68  $temp_dir = realpath($temp_dir); 
     69} 
     70 
    6671if (!is_array($_SESSION['compose']['attachments'])) { 
    6772  $_SESSION['compose']['attachments'] = array(); 
     
    7479  foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath) { 
    7580    $tmpfname = tempnam($temp_dir, 'rcmAttmnt'); 
    76     if (move_uploaded_file($filepath, $tmpfname)) { 
     81    if (move_uploaded_file($filepath, $tmpfname) && file_exists($tmpfname)) { 
    7782      $id = count($_SESSION['compose']['attachments']); 
    7883      $_SESSION['compose']['attachments'][] = array( 
Note: See TracChangeset for help on using the changeset viewer.