Changeset 4643 in subversion
- Timestamp:
- Apr 11, 2011 8:24:00 AM (2 years ago)
- Location:
- branches/release-0.5
- Files:
-
- 10 edited
-
CHANGELOG (modified) (1 diff)
-
plugins/managesieve/localization/pl_PL.inc (modified) (1 diff)
-
program/include/rcube_imap.php (modified) (2 diffs)
-
program/include/rcube_imap_generic.php (modified) (7 diffs)
-
program/include/rcube_mdb2.php (modified) (1 diff)
-
program/include/rcube_message.php (modified) (1 diff)
-
program/js/app.js (modified) (3 diffs)
-
program/lib/html2text.php (modified) (3 diffs)
-
program/steps/mail/func.inc (modified) (4 diffs)
-
program/steps/settings/save_prefs.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-0.5/CHANGELOG
r4626 r4643 2 2 =========================== 3 3 4 - Support 'abort' and 'result' response in 'preferences_save' hook, add error handling 5 - Fix bug where some content would cause hang on html2text conversion (#1487863) 6 - Improve space-stuffing handling in format=flowed messages (#1487861) 7 - Fix bug where some dates would produce SQL error in MySQL (#1487856) 8 - Added workaround for some IMAP server with broken STATUS response (#1487859) 9 - Fix bug where default_charset was not used for text messages (#1487836) 4 10 - Stateless request tokens. No keep-alive necessary on login page (#1487829) 5 11 - PEAR::Net_SMTP 1.5.1 -
branches/release-0.5/plugins/managesieve/localization/pl_PL.inc
r4069 r4643 49 49 $labels['filterset'] = 'Zbiór filtrów'; 50 50 $labels['filtersetadd'] = 'Dodaj zbiór filtrów'; 51 $labels['filtersetdel'] = 'UsuÅ bie rzÄ51 $labels['filtersetdel'] = 'UsuÅ bieÅŒÄ 52 52 cy zbiór filtrów'; 53 $labels['filtersetact'] = 'Aktywuj bie rzÄ53 $labels['filtersetact'] = 'Aktywuj bieÅŒÄ 54 54 cy zbiór filtrów'; 55 $labels['filtersetdeact'] = 'Deaktywuj bie rzÄ55 $labels['filtersetdeact'] = 'Deaktywuj bieÅŒÄ 56 56 cy zbiór filtrów'; 57 $labels['filtersetget'] = 'Pobierz bie rzÄ57 $labels['filtersetget'] = 'Pobierz bieÅŒÄ 58 58 cy zbiór filtrów w formacie tekstowym'; 59 59 $labels['filterdef'] = 'Definicja filtra'; -
branches/release-0.5/program/include/rcube_imap.php
r4593 r4643 2427 2427 * @param mixed $print True to print part, ressource to write part contents in 2428 2428 * @param resource $fp File pointer to save the message part 2429 * @param boolean $skip_charset_conv Disables charset conversion 2430 * 2429 2431 * @return string Message/part body if not printed 2430 2432 */ 2431 function &get_message_part($uid, $part=1, $o_part=NULL, $print=NULL, $fp=NULL )2433 function &get_message_part($uid, $part=1, $o_part=NULL, $print=NULL, $fp=NULL, $skip_charset_conv=false) 2432 2434 { 2433 2435 // get part encoding if not provided … … 2459 2461 } 2460 2462 2461 // convert charset (if text or message part) and part's charset is specified2462 if ($body && $o_part->charset2463 &&preg_match('/^(text|message)$/', $o_part->ctype_primary)2463 // convert charset (if text or message part) 2464 if ($body && !$skip_charset_conv && 2465 preg_match('/^(text|message)$/', $o_part->ctype_primary) 2464 2466 ) { 2467 if (!$o_part->charset || strtoupper($o_part->charset) == 'US-ASCII') { 2468 $o_part->charset = $this->default_charset; 2469 } 2465 2470 $body = rcube_charset_convert($body, $o_part->charset); 2466 2471 } -
branches/release-0.5/program/include/rcube_imap_generic.php
r4607 r4643 965 965 list($mbox, $items) = $this->tokenizeResponse($response, 2); 966 966 967 // Fix for #1487859. Some buggy server returns not quoted 968 // folder name with spaces. Let's try to handle this situation 969 if (!is_array($items) && ($pos = strpos($response, '(')) !== false) { 970 $response = substr($response, $pos); 971 $items = $this->tokenizeResponse($response, 1); 972 if (!is_array($items)) { 973 return $result; 974 } 975 } 976 967 977 for ($i=0, $len=count($items); $i<$len; $i += 2) { 968 978 $result[$items[$i]] = (int) $items[$i+1]; … … 1570 1580 $str = $matches[1]; 1571 1581 1572 // swap parents with quotes, then explode 1573 $str = preg_replace('/[()]/', '"', $str); 1574 $a = rcube_explode_quoted_string(' ', $str); 1575 1576 // did we get the right number of replies? 1577 $parts_count = count($a); 1578 if ($parts_count>=6) { 1579 for ($i=0; $i<$parts_count; $i=$i+2) { 1580 if ($a[$i] == 'UID') { 1581 $result[$id]->uid = intval($a[$i+1]); 1582 } 1583 else if ($a[$i] == 'RFC822.SIZE') { 1584 $result[$id]->size = intval($a[$i+1]); 1585 } 1586 else if ($a[$i] == 'INTERNALDATE') { 1587 $time_str = $a[$i+1]; 1588 } 1589 else if ($a[$i] == 'FLAGS') { 1590 $flags_str = $a[$i+1]; 1591 } 1582 while (list($name, $value) = $this->tokenizeResponse($str, 2)) { 1583 if ($name == 'UID') { 1584 $result[$id]->uid = intval($value); 1592 1585 } 1593 1594 $time_str = str_replace('"', '', $time_str); 1595 1596 // if time is gmt... 1597 $time_str = str_replace('GMT','+0000',$time_str); 1598 1599 $result[$id]->internaldate = $time_str; 1600 $result[$id]->timestamp = $this->StrToTime($time_str); 1601 $result[$id]->date = $time_str; 1586 else if ($name == 'RFC822.SIZE') { 1587 $result[$id]->size = intval($value); 1588 } 1589 else if ($name == 'INTERNALDATE') { 1590 $result[$id]->internaldate = $value; 1591 $result[$id]->date = $value; 1592 $result[$id]->timestamp = $this->StrToTime($value); 1593 } 1594 else if ($name == 'FLAGS') { 1595 $flags_a = $value; 1596 } 1602 1597 } 1603 1598 … … 1647 1642 // handle FLAGS reply after headers (AOL, Zimbra?) 1648 1643 if (preg_match('/\s+FLAGS \((.*)\)\)$/', $line, $matches)) { 1649 $flags_ str = $matches[1];1644 $flags_a = $this->tokenizeResponse($matches[1]); 1650 1645 break; 1651 1646 } … … 1671 1666 // create array with header field:data 1672 1667 while (list($lines_key, $str) = each($lines)) { 1673 list($field, $string) = $this->splitHeaderLine($str);1668 list($field, $string) = explode(':', $str, 2); 1674 1669 1675 1670 $field = strtolower($field); 1676 $string = preg_replace('/\n \s*/', ' ', $string);1671 $string = preg_replace('/\n[\t\s]*/', ' ', trim($string)); 1677 1672 1678 1673 switch ($field) { … … 1738 1733 1739 1734 // process flags 1740 if (!empty($flags_ str)) {1741 $flags_str = preg_replace('/[\\\"]/', '', $flags_str);1742 $flags_a = explode(' ', $flags_str);1743 1744 if (is_array($flags_a)) { 1745 foreach($flags_a as $flag) {1746 $flag = strtoupper($flag);1747 if ($flag == 'SEEN') {1748 $result[$id]->seen = true;1749 } else if ($flag == 'DELETED') {1750 $result[$id]->deleted = true;1751 } else if ($flag == 'RECENT') {1752 $result[$id]->recent = true;1753 } else if ($flag == 'ANSWERED') {1754 $result[$id]->answered = true;1755 } else if ($flag == '$FORWARDED') {1756 $result[$id]->forwarded = true;1757 } else if ($flag == 'DRAFT') {1758 $result[$id]->is_draft = true;1759 } else if ($flag == '$MDNSENT') {1760 $result[$id]->mdn_sent = true;1761 } else if ($flag == 'FLAGGED') {1762 $result[$id]->flagged = true;1763 }1735 if (!empty($flags_a)) { 1736 foreach ($flags_a as $flag) { 1737 $flag = str_replace('\\', '', $flag); 1738 $result[$id]->flags[] = $flag; 1739 1740 switch (strtoupper($flag)) { 1741 case 'SEEN': 1742 $result[$id]->seen = true; 1743 break; 1744 case 'DELETED': 1745 $result[$id]->deleted = true; 1746 break; 1747 case 'ANSWERED': 1748 $result[$id]->answered = true; 1749 break; 1750 case '$FORWARDED': 1751 $result[$id]->forwarded = true; 1752 break; 1753 case '$MDNSENT': 1754 $result[$id]->mdn_sent = true; 1755 break; 1756 case 'FLAGGED': 1757 $result[$id]->flagged = true; 1758 break; 1764 1759 } 1765 $result[$id]->flags = $flags_a;1766 1760 } 1767 1761 } … … 3298 3292 // support non-standard "GMTXXXX" literal 3299 3293 $date = preg_replace('/GMT\s*([+-][0-9]+)/', '\\1', $date); 3294 3300 3295 // if date parsing fails, we have a date in non-rfc format. 3301 3296 // remove token from the end and try again 3302 while (( ($ts = @strtotime($date))===false) || ($ts < 0)) {3297 while (($ts = intval(@strtotime($date))) <= 0) { 3303 3298 $d = explode(' ', $date); 3304 3299 array_pop($d); … … 3312 3307 3313 3308 return $ts < 0 ? 0 : $ts; 3314 }3315 3316 private function splitHeaderLine($string)3317 {3318 $pos = strpos($string, ':');3319 if ($pos>0) {3320 $res[0] = substr($string, 0, $pos);3321 $res[1] = trim(substr($string, $pos+1));3322 return $res;3323 }3324 return $string;3325 3309 } 3326 3310 -
branches/release-0.5/program/include/rcube_mdb2.php
r4057 r4643 554 554 function fromunixtime($timestamp) 555 555 { 556 switch($this->db_provider) { 557 case 'mysqli': 558 case 'mysql': 559 case 'sqlite': 560 return sprintf("FROM_UNIXTIME(%d)", $timestamp); 561 562 default: 563 return date("'Y-m-d H:i:s'", $timestamp); 564 } 556 return date("'Y-m-d H:i:s'", $timestamp); 565 557 } 566 558 -
branches/release-0.5/program/include/rcube_message.php
r4516 r4643 726 726 } 727 727 else if ($line) { 728 $line = ' ' . rc_wordwrap(rtrim($line), $length - 2, " \r\n "); 728 $line = rc_wordwrap(rtrim($line), $length - 2, " \r\n"); 729 // space-stuffing 730 $line = preg_replace('/(^|\r\n)(From| |>)/', '\\1 \\2', $line); 729 731 } 730 732 -
branches/release-0.5/program/js/app.js
r4469 r4643 2995 2995 { 2996 2996 // check input fields 2997 var value_to = $("[name='_to']").val();2998 var value_cc = $("[name='_cc']").val();2999 var value_bcc = $("[name='_bcc']").val();3000 var value_subject = $("[name='_subject']").val();3001 var str = '';2997 var ed, str = '', 2998 value_to = $("[name='_to']").val(), 2999 value_cc = $("[name='_cc']").val(), 3000 value_bcc = $("[name='_bcc']").val(), 3001 value_subject = $("[name='_subject']").val(); 3002 3002 3003 3003 if (value_to) … … 3010 3010 str += value_subject+':'; 3011 3011 3012 var editor = tinyMCE.get(this.env.composebody); 3013 if (editor) 3014 str += editor.getContent(); 3012 if (window.tinyMCE && (ed = tinyMCE.get(this.env.composebody))) 3013 str += ed.getContent(); 3015 3014 else 3016 3015 str += $("[name='_message']").val(); … … 4623 4622 4624 4623 if ((current_li = this.get_folder_li(old, prefix))) { 4625 $(current_li).removeClass('selected'). removeClass('unfocused');4624 $(current_li).removeClass('selected').addClass('unfocused'); 4626 4625 } 4627 4626 if ((target_li = this.get_folder_li(name, prefix))) { -
branches/release-0.5/program/lib/html2text.php
r4593 r4643 573 573 function _convert_pre(&$text) 574 574 { 575 // get the content of PRE element 575 576 while (preg_match('/<pre[^>]*>(.*)<\/pre>/ismU', $text, $matches)) { 576 $result = preg_replace($this->pre_search, $this->pre_replace, $matches[1]); 577 $text = preg_replace('/<pre[^>]*>.*<\/pre>/ismU', '<div><br>' . $result . '<br></div>', $text, 1); 577 // convert the content 578 $this->pre_content = sprintf('<div><br>%s<br></div>', 579 preg_replace($this->pre_search, $this->pre_replace, $matches[1])); 580 // replace the content (use callback because content can contain $0 variable) 581 $text = preg_replace_callback('/<pre[^>]*>.*<\/pre>/ismU', 582 array('html2text', '_preg_pre_callback'), $text, 1); 583 // free memory 584 $this->pre_content = ''; 578 585 } 579 586 } … … 640 647 * @param array PREG matches 641 648 * @return string 642 * @access private 643 */ 644 function _preg_callback($matches) 649 */ 650 private function _preg_callback($matches) 645 651 { 646 652 switch($matches[1]) { … … 660 666 661 667 /** 668 * Callback function for preg_replace_callback use in PRE content handler. 669 * 670 * @param array PREG matches 671 * @return string 672 */ 673 private function _preg_pre_callback($matches) 674 { 675 return $this->pre_content; 676 } 677 678 /** 662 679 * Strtoupper multibyte wrapper function 663 680 * 664 681 * @param string 665 682 * @return string 666 * @access private 667 */ 668 function _strtoupper($str) 683 */ 684 private function _strtoupper($str) 669 685 { 670 686 if (function_exists('mb_strtoupper')) -
branches/release-0.5/program/steps/mail/func.inc
r4593 r4643 727 727 728 728 // split body into single lines 729 $ a_lines= preg_split('/\r?\n/', $body);729 $body = preg_split('/\r?\n/', $body); 730 730 $quote_level = 0; 731 731 $last = -1; 732 732 733 733 // find/mark quoted lines... 734 for ($n=0, $cnt=count($ a_lines); $n < $cnt; $n++) {735 if ($ a_lines[$n][0] == '>' && preg_match('/^(>+\s*)+/', $a_lines[$n], $regs)) {734 for ($n=0, $cnt=count($body); $n < $cnt; $n++) { 735 if ($body[$n][0] == '>' && preg_match('/^(>+\s*)+/', $body[$n], $regs)) { 736 736 $q = strlen(preg_replace('/\s/', '', $regs[0])); 737 $a_lines[$n] = substr($a_lines[$n], strlen($regs[0])); 738 739 if ($q > $quote_level) 740 $a_lines[$n] = $replacer->get_replacement($replacer->add( 741 str_repeat('<blockquote>', $q - $quote_level))) . $a_lines[$n]; 742 else if ($q < $quote_level) 743 $a_lines[$n] = $replacer->get_replacement($replacer->add( 744 str_repeat('</blockquote>', $quote_level - $q))) . $a_lines[$n]; 737 $body[$n] = substr($body[$n], strlen($regs[0])); 738 739 if ($q > $quote_level) { 740 $body[$n] = $replacer->get_replacement($replacer->add( 741 str_repeat('<blockquote>', $q - $quote_level))) . $body[$n]; 742 } 743 else if ($q < $quote_level) { 744 $body[$n] = $replacer->get_replacement($replacer->add( 745 str_repeat('</blockquote>', $quote_level - $q))) . $body[$n]; 746 } 745 747 else if ($flowed) { 746 748 // previous line is flowed 747 if (isset($ a_lines[$last]) && $a_lines[$n]748 && $ a_lines[$last][strlen($a_lines[$last])-1] == ' ') {749 if (isset($body[$last]) && $body[$n] 750 && $body[$last][strlen($body[$last])-1] == ' ') { 749 751 // merge lines 750 $ a_lines[$last] .= $a_lines[$n];751 unset($ a_lines[$n]);752 $body[$last] .= $body[$n]; 753 unset($body[$n]); 752 754 } 753 else 755 else { 754 756 $last = $n; 757 } 755 758 } 756 759 } … … 759 762 if ($flowed) { 760 763 // sig separator - line is fixed 761 if ($ a_lines[$n] == '-- ') {762 $last = $ n;764 if ($body[$n] == '-- ') { 765 $last = $last_sig = $n; 763 766 } 764 767 else { 765 768 // remove space-stuffing 766 if ($ a_lines[$n][0] == ' ')767 $ a_lines[$n] = substr($a_lines[$n], 1);769 if ($body[$n][0] == ' ') 770 $body[$n] = substr($body[$n], 1); 768 771 769 772 // previous line is flowed? 770 if (isset($ a_lines[$last]) && $a_lines[$n]771 && $ a_lines[$last] != '-- '772 && $ a_lines[$last][strlen($a_lines[$last])-1] == ' '773 if (isset($body[$last]) && $body[$n] 774 && $last != $last_sig 775 && $body[$last][strlen($body[$last])-1] == ' ' 773 776 ) { 774 $ a_lines[$last] .= $a_lines[$n];775 unset($ a_lines[$n]);777 $body[$last] .= $body[$n]; 778 unset($body[$n]); 776 779 } 777 780 else { … … 780 783 } 781 784 if ($quote_level > 0) 782 $ a_lines[$last] = $replacer->get_replacement($replacer->add(783 str_repeat('</blockquote>', $quote_level))) . $ a_lines[$last];785 $body[$last] = $replacer->get_replacement($replacer->add( 786 str_repeat('</blockquote>', $quote_level))) . $body[$last]; 784 787 } 785 788 else if ($quote_level > 0) 786 $ a_lines[$n] = $replacer->get_replacement($replacer->add(787 str_repeat('</blockquote>', $quote_level))) . $ a_lines[$n];789 $body[$n] = $replacer->get_replacement($replacer->add( 790 str_repeat('</blockquote>', $quote_level))) . $body[$n]; 788 791 } 789 792 … … 791 794 } 792 795 793 $body = join("\n", $ a_lines);796 $body = join("\n", $body); 794 797 795 798 // quote plain text (don't use Q() here, to display entities "as is") -
branches/release-0.5/program/steps/settings/save_prefs.inc
r4469 r4643 98 98 } 99 99 100 $ data= rcmail::get_instance()->plugins->exec_hook('preferences_save',100 $plugin = rcmail::get_instance()->plugins->exec_hook('preferences_save', 101 101 array('prefs' => $a_user_prefs, 'section' => $CURR_SECTION)); 102 102 103 $a_user_prefs = $ data['prefs'];103 $a_user_prefs = $plugin['prefs']; 104 104 105 105 // don't override these parameters … … 160 160 } 161 161 162 if ($USER->save_prefs($a_user_prefs)) 162 // Save preferences 163 if (!$plugin['abort']) 164 $saved = $USER->save_prefs($a_user_prefs); 165 else 166 $saved = $plugin['result']; 167 168 if ($saved) 163 169 $OUTPUT->show_message('successfullysaved', 'confirmation'); 170 else 171 $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error'); 164 172 165 173 // display the form again 166 174 rcmail_overwrite_action('edit-prefs'); 167 175 168
Note: See TracChangeset
for help on using the changeset viewer.
