Changeset 5542 in subversion
- Timestamp:
- Dec 5, 2011 2:15:31 AM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/mail/attachments.inc
r5226 r5542 26 26 27 27 $COMPOSE_ID = get_input_value('_id', RCUBE_INPUT_GPC); 28 $ _SESSION['compose'] = $_SESSION['compose_data_'.$COMPOSE_ID];28 $COMPOSE = null; 29 29 30 if (!$_SESSION['compose']) { 30 if ($COMPOSE_ID && $_SESSION['compose_data_'.$COMPOSE_ID]) 31 $COMPOSE =& $_SESSION['compose_data_'.$COMPOSE_ID]; 32 33 if (!$COMPOSE) { 31 34 die("Invalid session var!"); 32 35 } … … 39 42 if (preg_match('/^rcmfile(\w+)$/', $_POST['_file'], $regs)) 40 43 $id = $regs[1]; 41 if ($attachment = $ _SESSION['compose']['attachments'][$id])44 if ($attachment = $COMPOSE['attachments'][$id]) 42 45 $attachment = $RCMAIL->plugins->exec_hook('attachment_delete', $attachment); 43 46 if ($attachment['status']) { 44 if (is_array($ _SESSION['compose']['attachments'][$id])) {45 unset($ _SESSION['compose']['attachments'][$id]);47 if (is_array($COMPOSE['attachments'][$id])) { 48 unset($COMPOSE['attachments'][$id]); 46 49 $OUTPUT->command('remove_from_attachment_list', "rcmfile$id"); 47 50 } 48 51 } 49 52 50 53 $OUTPUT->send(); 51 54 exit; … … 57 60 if (preg_match('/^rcmfile(\w+)$/', $_GET['_file'], $regs)) 58 61 $id = $regs[1]; 59 if ($attachment = $ _SESSION['compose']['attachments'][$id])62 if ($attachment = $COMPOSE['attachments'][$id]) 60 63 $attachment = $RCMAIL->plugins->exec_hook('attachment_display', $attachment); 61 64 62 65 if ($attachment['status']) { 63 66 if (empty($attachment['size'])) … … 66 69 header('Content-Type: ' . $attachment['mimetype']); 67 70 header('Content-Length: ' . $attachment['size']); 68 71 69 72 if ($attachment['data']) 70 73 echo $attachment['data']; … … 77 80 // attachment upload action 78 81 79 if (!is_array($ _SESSION['compose']['attachments'])) {80 $ _SESSION['compose']['attachments'] = array();82 if (!is_array($COMPOSE['attachments'])) { 83 $COMPOSE['attachments'] = array(); 81 84 } 82 85 … … 108 111 // store new attachment in session 109 112 unset($attachment['status'], $attachment['abort']); 110 $ _SESSION['compose']['attachments'][$id] = $attachment;113 $COMPOSE['attachments'][$id] = $attachment; 111 114 112 if (($icon = $ _SESSION['compose']['deleteicon']) && is_file($icon)) {115 if (($icon = $COMPOSE['deleteicon']) && is_file($icon)) { 113 116 $button = html::img(array( 114 117 'src' => $icon,
Note: See TracChangeset
for help on using the changeset viewer.
