Changeset 5f314da in github


Ignore:
Timestamp:
Sep 5, 2008 7:38:09 AM (5 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
94e4be5
Parents:
8b36d421
Message:

Correctly handle options in mailto-links (#1485228)

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r6695db8 r5f314da  
    1010- Also capture backspace key in list mode (#1484566) 
    1111- Allow application/pgp parts to be displayed (#1484753) 
     12- Correctly handle options in mailto-links (#1485228) 
    1213 
    13142008/09/04 (alec) 
  • program/steps/mail/compose.inc

    r8beee1b r5f314da  
    6666  $_SESSION['compose'] = array('id' => uniqid(rand()), 'param' => array_map('strip_tags', $_GET)); 
    6767   
     68  // process values like "mailto:foo@bar.com?subject=new+message&cc=another" 
     69  if ($_SESSION['compose']['param']['_to']) { 
     70    $mailto = explode('?', $_SESSION['compose']['param']['_to']); 
     71    if (count($mailto) > 1) { 
     72      $_SESSION['compose']['param']['_to'] = $mailto[0]; 
     73      parse_str($mailto[1], $query); 
     74      foreach ($query as $f => $val) 
     75        $_SESSION['compose']['param']["_$f"] = $val; 
     76    } 
     77  } 
     78 
    6879  // redirect to a unique URL with all parameters stored in session 
    6980  $OUTPUT->redirect(array('_action' => 'compose', '_id' => $_SESSION['compose']['id'])); 
     
    144155      if (($mailto_id = $_SESSION['compose']['param']['_mailto']) && $_SESSION['mailto'][$mailto_id]) 
    145156        $fvalue = urldecode($_SESSION['mailto'][$mailto_id]); 
    146       else if (!empty($_SESSION['compose']['param']['_to'])) 
    147         $fvalue = $_SESSION['compose']['param']['_to']; 
    148          
     157       
    149158    case 'cc': 
    150159      if (!$fname) 
     
    169178      $allow_attrib = array('id', 'class', 'style', 'size', 'tabindex'); 
    170179      $field_type = 'html_inputfield'; 
    171       break;     
     180      break; 
    172181  } 
    173182  
    174183  if ($fname && !empty($_POST[$fname])) 
    175184    $fvalue = get_input_value($fname, RCUBE_INPUT_POST, TRUE); 
     185  else if ($fname && !$fvalue && !empty($_SESSION['compose']['param'][$fname])) 
     186    $fvalue = $_SESSION['compose']['param'][$fname]; 
    176187 
    177188  else if ($header && $compose_mode == RCUBE_COMPOSE_REPLY) 
     
    386397    else if ($compose_mode == RCUBE_COMPOSE_DRAFT) 
    387398      $body = rcmail_create_draft_body($body, $isHtml); 
     399  } 
     400  else if (!empty($_SESSION['compose']['param']['_body'])) 
     401  { 
     402    $body = $_SESSION['compose']['param']['_body']; 
    388403  } 
    389404 
     
    609624 
    610625  // use subject from post 
    611   if (isset($_POST['_subject'])) 
     626  if (isset($_POST['_subject'])) { 
    612627    $subject = get_input_value('_subject', RCUBE_INPUT_POST, TRUE); 
    613      
     628  } 
    614629  // create a reply-subject 
    615   else if ($compose_mode == RCUBE_COMPOSE_REPLY) 
    616   { 
     630  else if ($compose_mode == RCUBE_COMPOSE_REPLY) { 
    617631    if (eregi('^re:', $MESSAGE->subject)) 
    618632      $subject = $MESSAGE->subject; 
     
    620634      $subject = 'Re: '.$MESSAGE->subject; 
    621635  } 
    622  
    623636  // create a forward-subject 
    624   else if ($compose_mode == RCUBE_COMPOSE_FORWARD) 
    625   { 
     637  else if ($compose_mode == RCUBE_COMPOSE_FORWARD) { 
    626638    if (eregi('^fwd:', $MESSAGE->subject)) 
    627639      $subject = $MESSAGE->subject; 
     
    629641      $subject = 'Fwd: '.$MESSAGE->subject; 
    630642  } 
    631  
    632643  // creeate a draft-subject 
    633   else if ($compose_mode == RCUBE_COMPOSE_DRAFT) 
     644  else if ($compose_mode == RCUBE_COMPOSE_DRAFT) { 
    634645    $subject = $MESSAGE->subject; 
     646  } 
     647  else if (!empty($_SESSION['compose']['param']['_subject'])) { 
     648    $subject = $_SESSION['compose']['param']['_subject']; 
     649  } 
    635650   
    636651  $out = $form_start ? "$form_start\n" : ''; 
Note: See TracChangeset for help on using the changeset viewer.