Changeset 5525 in subversion


Ignore:
Timestamp:
Dec 2, 2011 2:51:07 AM (18 months ago)
Author:
alec
Message:
  • Improved handling of some malformed values encoded with quoted-printable (#1488232)
Location:
trunk/roundcubemail
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r5515 r5525  
    22=========================== 
    33 
     4- Improved handling of some malformed values encoded with quoted-printable (#1488232) 
    45- Add possibility to do LDAP bind before searching for bind DN 
    56- Fix handling of empty <U> tags in HTML messages (#1488225) 
  • trunk/roundcubemail/program/include/rcube_imap.php

    r5486 r5525  
    41654165 
    41664166        // encoded-word regexp 
    4167         $re = '/=\?([^?]+)\?([BbQq])\?([^?\n]*)\?=/'; 
     4167        $re = '/=\?([^?]+)\?([BbQq])\?([^\n]*?)\?=/'; 
    41684168 
    41694169        // Find all RFC2047's encoded words 
  • trunk/roundcubemail/tests/maildecode.php

    r5034 r5525  
    8585  } 
    8686 
     87  /** 
     88   * Test decoding of header values 
     89   * Uses rcube_imap::decode_mime_string() 
     90   */ 
     91  function test_header_decode_qp() 
     92  { 
     93    $test = array( 
     94      // #1488232: invalid character "?" 
     95      'quoted-printable (1)' => array( 
     96        'in'  => '=?utf-8?Q?Certifica=C3=A7=C3=A3??=', 
     97        'out' => 'Certifica=C3=A7=C3=A3?', 
     98      ), 
     99      'quoted-printable (2)' => array( 
     100        'in'  => '=?utf-8?Q?Certifica=?= =?utf-8?Q?C3=A7=C3=A3?=', 
     101        'out' => 'Certifica=C3=A7=C3=A3', 
     102      ), 
     103      'quoted-printable (3)' => array( 
     104        'in'  => '=?utf-8?Q??= =?utf-8?Q??=', 
     105        'out' => '', 
     106      ), 
     107      'quoted-printable (4)' => array( 
     108        'in'  => '=?utf-8?Q??= a =?utf-8?Q??=', 
     109        'out' => ' a ', 
     110      ), 
     111      'quoted-printable (5)' => array( 
     112        'in'  => '=?utf-8?Q?a?= =?utf-8?Q?b?=', 
     113        'out' => 'ab', 
     114      ), 
     115      'quoted-printable (6)' => array( 
     116        'in'  => '=?utf-8?Q?   ?= =?utf-8?Q?a?=', 
     117        'out' => '   a', 
     118      ), 
     119      'quoted-printable (7)' => array( 
     120        'in'  => '=?utf-8?Q?___?= =?utf-8?Q?a?=', 
     121        'out' => '   a', 
     122      ), 
     123    ); 
     124 
     125    foreach ($test as $idx => $item) { 
     126      $res = $this->app->imap->decode_mime_string($item['in'], 'UTF-8'); 
     127      $res = quoted_printable_encode($res); 
     128 
     129      $this->assertEqual($item['out'], $res, "Header decoding for: " . $idx); 
     130    } 
     131 
     132  } 
    87133} 
Note: See TracChangeset for help on using the changeset viewer.