From 70d4b9a5dc39a7165e469aa3b4f24d49e9a20b9e Mon Sep 17 00:00:00 2001 From: thomascube Date: Fri, 8 Sep 2006 12:03:22 +0000 Subject: Fixed safe_mode issues --- program/steps/mail/compose.inc | 6 +++--- program/steps/mail/func.inc | 28 +--------------------------- program/steps/mail/upload.inc | 4 ++-- 3 files changed, 6 insertions(+), 32 deletions(-) (limited to 'program/steps/mail') diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 14adb1266..29fdddd06 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -497,9 +497,9 @@ function rcmail_create_draft_body($body) function rcmail_write_compose_attachments(&$message) { - global $IMAP; - - $temp_dir = rcmail_create_compose_tempdir(); + global $IMAP, $CONFIG; + + $temp_dir = unslashify($CONFIG['temp_dir']); if (!is_array($_SESSION['compose']['attachments'])) $_SESSION['compose']['attachments'] = array(); diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 827f13100..b51ec4b80 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1384,42 +1384,16 @@ function rcmail_message_part_frame($attrib) } -// create temp dir for attachments -function rcmail_create_compose_tempdir() - { - global $CONFIG; - - if ($_SESSION['compose']['temp_dir']) - return $_SESSION['compose']['temp_dir']; - - if (!empty($CONFIG['temp_dir'])) - $temp_dir = $CONFIG['temp_dir'].(!eregi('\/$', $CONFIG['temp_dir']) ? '/' : '').$_SESSION['compose']['id']; - - // create temp-dir for uploaded attachments - if (!empty($CONFIG['temp_dir']) && is_writeable($CONFIG['temp_dir'])) - { - mkdir($temp_dir); - $_SESSION['compose']['temp_dir'] = $temp_dir; - } - - return $_SESSION['compose']['temp_dir']; - } - - // clear message composing settings function rcmail_compose_cleanup() { if (!isset($_SESSION['compose'])) return; - + // remove attachment files from temp dir if (is_array($_SESSION['compose']['attachments'])) foreach ($_SESSION['compose']['attachments'] as $attachment) @unlink($attachment['path']); - - // kill temp dir - if ($_SESSION['compose']['temp_dir']) - @rmdir($_SESSION['compose']['temp_dir']); unset($_SESSION['compose']); } diff --git a/program/steps/mail/upload.inc b/program/steps/mail/upload.inc index 850ccd01d..cde4ed2d4 100644 --- a/program/steps/mail/upload.inc +++ b/program/steps/mail/upload.inc @@ -26,8 +26,8 @@ if (!$_SESSION['compose']) } -// create temp dir for file uploads -$temp_dir = rcmail_create_compose_tempdir(); +// use common temp dir for file uploads +$temp_dir = unslashify($CONFIG['temp_dir']); if (!is_array($_SESSION['compose']['attachments'])) -- cgit v1.2.3