Changeset ad18d63 in github


Ignore:
Timestamp:
Feb 5, 2010 3:25:22 AM (3 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
b620493a
Parents:
8955ca6
Message:
  • Fix handling of extended mailto links (with params) (#1486354)
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    ra79e5f1 rad18d63  
    22=========================== 
    33 
     4- Fix handling of extended mailto links (with params) (#1486354) 
    45- Fix sorting by date of messages without date header on servers without SORT (#1486286) 
    56- Fix inconsistency when not using default table names (#1486467) 
  • program/steps/mail/func.inc

    r96b679d rad18d63  
    11491149    $end = ' />'; 
    11501150  } 
    1151   else if (preg_match("/^mailto:$EMAIL_ADDRESS_PATTERN/i", $attrib['href'], $mailto)) { 
     1151  else if (preg_match('/^mailto:'.$EMAIL_ADDRESS_PATTERN.'(\?[^"\'>]+)?/i', $attrib['href'], $mailto)) { 
    11521152    $attrib['href'] = $mailto[0]; 
    11531153    $attrib['onclick'] = sprintf( 
    11541154      "return %s.command('compose','%s',this)", 
    11551155      JS_OBJECT_NAME, 
    1156       JQ($mailto[1])); 
     1156      JQ($mailto[1].$mailto[2])); 
    11571157  } 
    11581158  else if (!empty($attrib['href']) && $attrib['href'][0] != '#') { 
  • tests/mailfunc.php

    r5570ad6 rad18d63  
    115115  } 
    116116 
     117  /** 
     118   * Test mailto links in html messages 
     119   */ 
     120  function test_mailto() 
     121  { 
     122    $part = $this->get_html_part('src/mailto.txt'); 
     123     
     124    // render HTML in normal mode 
     125    $html = rcmail_html4inline(rcmail_print_body($part, array('safe' => false)), 'foo'); 
     126 
     127    $mailto = '<a href="mailto:me@me.com?subject=this is the subject&amp;body=this is the body"' 
     128      .' onclick="return rcmail.command(\'compose\',\'me@me.com?subject=this is the subject&amp;body=this is the body\',this)">e-mail</a>'; 
     129 
     130    $this->assertPattern('|'.preg_quote($mailto, '|').'|', $html, "Extended mailto links"); 
     131  } 
     132 
    117133} 
    118134 
Note: See TracChangeset for help on using the changeset viewer.