Changeset 597170f in github for program/steps/mail/compose.inc
- Timestamp:
- Oct 4, 2005 4:28:01 PM (8 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 42b1135
- Parents:
- 6dc0269
- File:
-
- 1 edited
-
program/steps/mail/compose.inc (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/steps/mail/compose.inc
r30233b8 r597170f 121 121 122 122 // we have contact id's as get parameters 123 if ( strlen($_GET['_to']) && preg_match('/[0-9]+,?/', $_GET['_to']))123 if (!empty($_GET['_to']) && preg_match('/[0-9]+,?/', $_GET['_to'])) 124 124 { 125 125 $a_recipients = array(); … … 139 139 $fvalue = join(', ', $a_recipients); 140 140 } 141 else if ( strlen($_GET['_to']))141 else if (!empty($_GET['_to'])) 142 142 $fvalue = $_GET['_to']; 143 143 … … 166 166 167 167 168 if ($fname && $_POST[$fname])168 if ($fname && !empty($_POST[$fname])) 169 169 $fvalue = $_POST[$fname]; 170 170 else if ($header && is_object($REPLY_MESSAGE['headers'])) … … 283 283 284 284 // use posted message body 285 if ( $_POST['_message'])285 if (!empty($_POST['_message'])) 286 286 $body = stripslashes($_POST['_message']); 287 287 … … 353 353 $IMAP->decode_header($FORWARD_MESSAGE['headers']->to)); 354 354 355 // add attachments 356 if (!isset($_SESSION['compose']['forward_attachments']) && is_array($FORWARD_MESSAGE['parts']) && sizeof($FORWARD_MESSAGE['parts'])>1) 357 { 358 $temp_dir = rcmail_create_compose_tempdir(); 359 360 if (!is_array($_SESSION['compose']['attachments'])) 361 $_SESSION['compose']['attachments'] = array(); 362 363 foreach ($FORWARD_MESSAGE['parts'] as $part) 364 { 365 if ($part->disposition != 'attachment') 366 continue; 367 368 $tmp_path = tempnam($temp_dir, 'rcmAttmnt'); 369 if ($fp = fopen($tmp_path, 'w')) 370 { 371 fwrite($fp, $IMAP->mime_decode($part->body, $part->headers['content-transfer-encoding'])); 372 fclose($fp); 373 374 $_SESSION['compose']['attachments'][] = array('name' => $part->d_parameters['filename'], 375 'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary, 376 'path' => $tmp_path); 377 } 378 } 379 380 $_SESSION['compose']['forward_attachments'] = TRUE; 381 } 382 355 383 return $prefix.$body; 356 384 } … … 371 399 372 400 // use subject from post 373 if ( $_POST['_subject'])401 if (isset($_POST['_subject'])) 374 402 $subject = stripslashes($_POST['_subject']); 375 403 … … 474 502 array(1, 2, 0, 4, 5)); 475 503 476 $sel = $_POST['_priority']? $_POST['_priority'] : 0;504 $sel = isset($_POST['_priority']) ? $_POST['_priority'] : 0; 477 505 478 506 $out = $form_start ? "$form_start\n" : ''; … … 494 522 $hiddenfields->add(array('name' => '_action', 'value' => 'send')); 495 523 496 $form_start = !strlen($attrib['form']) ? '<form name="form" action="./" method="post">' : '';524 $form_start = empty($attrib['form']) ? '<form name="form" action="./" method="post">' : ''; 497 525 $form_start .= "\n$SESS_HIDDEN_FIELD\n"; 498 526 $form_start .= $hiddenfields->show(); … … 500 528 501 529 $form_end = (strlen($MESSAGE_FORM) && !strlen($attrib['form'])) ? '</form>' : ''; 502 $form_name = strlen($attrib['form']) ? $attrib['form'] : 'form';530 $form_name = !empty($attrib['form']) ? $attrib['form'] : 'form'; 503 531 504 532 if (!strlen($MESSAGE_FORM))
Note: See TracChangeset
for help on using the changeset viewer.
