fixes. However, we should prefer using move_uploaded_file over rename
because move_uploaded_file works better with safe_mode/open_basedir
restrictions. Not doing that now because we're in rc phase.
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4420
7612ce4b-ef26-0410-bec9-
ea0150e637f0
$full_localfilename = "$hashed_attachment_dir/$localfilename";
}
- if (!@move_uploaded_file($_FILES['attachfile']['tmp_name'],$full_localfilename)) {
- return true;
+ // FIXME: we SHOULD prefer move_uploaded_file over rename because
+ // m_u_f works better with restricted PHP installes (safe_mode, open_basedir)
+ if (!@rename($_FILES['attachfile']['tmp_name'], $full_localfilename)) {
+ if (!@move_uploaded_file($_FILES['attachfile']['tmp_name'],$full_localfilename)) {
+ return true;
+ }
}
-
$message = $compose_messages[$session];
$type = strtolower($_FILES['attachfile']['type']);
$name = $_FILES['attachfile']['name'];