Changeset 77799d8 in github
- Timestamp:
- Apr 27, 2012 3:24:24 AM (14 months ago)
- Branches:
- release-0.7
- Children:
- 9899abc
- Parents:
- cba69dd
- Files:
-
- 6 edited
-
CHANGELOG (modified) (1 diff)
-
index.php (modified) (1 diff)
-
program/include/rcube_vcard.php (modified) (5 diffs)
-
program/js/app.js (modified) (23 diffs)
-
program/steps/mail/sendmail.inc (modified) (1 diff)
-
tests/vcards.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
rf451a1c r77799d8 2 2 =========================== 3 3 4 - Fix redirect to mail/compose on re-login (#1488226) 5 - Add IE8 hack for messages list issue (#1487821) 6 - Fix handling errors on draft auto-save 7 - Fix importing vCard photo with ENCODING param specified (#1488432) 8 - Fix issue where draft auto-save wasn't executed after some inactivity time 4 9 - Fix lack of warning when switching task in compose window (#1488399) 5 10 - Fix bug where it wasn't possible to enter ( or & characters in autocomplete fields -
index.php
r315993e r77799d8 120 120 if ($query['_task'] == 'login') 121 121 unset($query['_task']); 122 123 // prevent redirect to compose with specified ID (#1488226) 124 if ($query['_action'] == 'compose' && !empty($query['_id'])) 125 $query = array(); 122 126 } 123 127 -
program/include/rcube_vcard.php
r4c4fe69 r77799d8 293 293 if (strpos($value, 'http:') === 0) { 294 294 // TODO: fetch file from URL and save it locally? 295 $this->raw['PHOTO'][0] = array(0 => $value, ' URL' => true);295 $this->raw['PHOTO'][0] = array(0 => $value, 'url' => true); 296 296 } 297 297 else { 298 $encoded = !preg_match('![^a-z0-9/=+-]!i', $value); 299 $this->raw['PHOTO'][0] = array(0 => $encoded ? $value : base64_encode($value), 'BASE64' => true); 298 $this->raw['PHOTO'][0] = array(0 => $value, 'base64' => (bool) preg_match('![^a-z0-9/=+-]!i', $value)); 300 299 } 301 300 break; … … 550 549 $entry = array(); 551 550 $field = strtoupper($regs2[1][0]); 551 $enc = null; 552 552 553 553 foreach($regs2[1] as $attrid => $attr) { … … 556 556 if ($key == 'ENCODING') { 557 557 // add next line(s) to value string if QP line end detected 558 while ($value == 'QUOTED-PRINTABLE' && preg_match('/=$/', $lines[$i])) 558 if ($value == 'QUOTED-PRINTABLE') { 559 while (preg_match('/=$/', $lines[$i])) 559 560 $line[2] .= "\n" . $lines[++$i]; 560 561 $ line[2] = self::decode_value($line[2], $value);561 } 562 $enc = $value; 562 563 } 563 else 564 $entry[strtolower($key)] = array_merge((array)$entry[strtolower($key)], (array)self::vcard_unquote($value, ',')); 564 else { 565 $lc_key = strtolower($key); 566 $entry[$lc_key] = array_merge((array)$entry[$lc_key], (array)self::vcard_unquote($value, ',')); 567 } 565 568 } 566 569 else if ($attrid > 0) { 567 $entry[ $key] = true; // true means attr without =value570 $entry[strtolower($key)] = true; // true means attr without =value 568 571 } 569 572 } 570 573 571 $entry = array_merge($entry, (array)self::vcard_unquote($line[2])); 574 // decode value 575 if ($enc || !empty($entry['base64'])) { 576 // save encoding type (#1488432) 577 if ($enc == 'B') { 578 $entry['encoding'] = 'B'; 579 // should we use vCard 3.0 instead? 580 // $entry['base64'] = true; 581 } 582 $line[2] = self::decode_value($line[2], $enc ? $enc : 'base64'); 583 } 584 585 if ($enc != 'B' && empty($entry['base64'])) { 586 $line[2] = self::vcard_unquote($line[2]); 587 } 588 589 $entry = array_merge($entry, (array) $line[2]); 572 590 $data[$field][] = $entry; 573 591 } … … 594 612 595 613 case 'base64': 614 case 'b': 596 615 self::$values_decoded = true; 597 616 return base64_decode($value); … … 625 644 $value = array(); 626 645 foreach($entry as $attrname => $attrvalues) { 627 if (is_int($attrname)) 646 if (is_int($attrname)) { 647 if (!empty($entry['base64']) || $entry['encoding'] == 'B') { 648 $attrvalues = base64_encode($attrvalues); 649 } 628 650 $value[] = $attrvalues; 629 elseif ($attrvalues === true) 630 $attr .= ";$attrname"; // true means just tag, not tag=value, as in PHOTO;BASE64:... 651 } 652 else if (is_bool($attrvalues)) { 653 if ($attrvalues) { 654 $attr .= strtoupper(";$attrname"); // true means just tag, not tag=value, as in PHOTO;BASE64:... 655 } 656 } 631 657 else { 632 658 foreach((array)$attrvalues as $attrvalue) 633 $attr .= ";$attrname=". self::vcard_quote($attrvalue, ',');659 $attr .= strtoupper(";$attrname=") . self::vcard_quote($attrvalue, ','); 634 660 } 635 661 } -
program/js/app.js
rf451a1c r77799d8 270 270 else if (this.env.action == 'print' && this.env.uid) 271 271 if (bw.safari) 272 window.setTimeout('window.print()', 10);272 setTimeout('window.print()', 10); 273 273 else 274 274 window.print(); … … 747 747 if (this.env.uid && this.env.sender) { 748 748 this.add_contact(urlencode(this.env.sender)); 749 window.setTimeout(function(){ ref.command('load-images'); }, 300);749 setTimeout(function(){ ref.command('load-images'); }, 300); 750 750 break; 751 751 } … … 765 765 this.attachment_win = window.open(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', 'rcubemailattachment'); 766 766 if (this.attachment_win) { 767 window.setTimeout(function(){ ref.attachment_win.focus(); }, 10);767 setTimeout(function(){ ref.attachment_win.focus(); }, 10); 768 768 break; 769 769 } … … 880 880 881 881 case 'savedraft': 882 var form = this.gui_objects.messageform, msgid; 883 882 884 // Reset the auto-save timer 883 self.clearTimeout(this.save_timer); 884 885 if (!this.gui_objects.messageform) 885 clearTimeout(this.save_timer); 886 887 // saving Drafts is disabled 888 if (!form) 886 889 break; 887 890 888 // if saving Drafts is disabled in main.inc.php889 // or if compose form did not change890 if (!this.env.drafts_mailbox || this.cmp_hash == this.compose_field_hash())891 // compose form did not change 892 if (this.cmp_hash == this.compose_field_hash()) { 893 this.auto_save_start(); 891 894 break; 892 893 var form = this.gui_objects.messageform, 894 msgid = this.set_busy(true, 'savingmessage'); 895 } 896 897 // re-set keep-alive timeout 898 this.start_keepalive(); 899 900 msgid = this.set_busy(true, 'savingmessage'); 895 901 896 902 form.target = "savetarget"; … … 908 914 909 915 // Reset the auto-save timer 910 self.clearTimeout(this.save_timer);916 clearTimeout(this.save_timer); 911 917 912 918 // all checks passed, send message … … 927 933 case 'send-attachment': 928 934 // Reset the auto-save timer 929 self.clearTimeout(this.save_timer);935 clearTimeout(this.save_timer); 930 936 931 937 this.upload_file(props) … … 965 971 ref.printwin = window.open(this.env.comm_path+'&_action=print&_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)+(this.env.safemode ? '&_safe=1' : '')); 966 972 if (this.printwin) { 967 window.setTimeout(function(){ ref.printwin.focus(); }, 20);973 setTimeout(function(){ ref.printwin.focus(); }, 20); 968 974 if (this.env.action != 'show') 969 975 this.mark_message('read', uid); … … 976 982 ref.sourcewin = window.open(this.env.comm_path+'&_action=viewsource&_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)); 977 983 if (this.sourcewin) 978 window.setTimeout(function(){ ref.sourcewin.focus(); }, 20);984 setTimeout(function(){ ref.sourcewin.focus(); }, 20); 979 985 } 980 986 break; … … 1121 1127 // set timer for requests 1122 1128 if (a && this.env.request_timeout) 1123 this.request_timer = window.setTimeout(function(){ ref.request_timed_out(); }, this.env.request_timeout * 1000);1129 this.request_timer = setTimeout(function(){ ref.request_timed_out(); }, this.env.request_timeout * 1000); 1124 1130 1125 1131 return id; … … 1173 1179 parent.rcmail.reload(delay); 1174 1180 else if (delay) 1175 window.setTimeout(function(){ rcmail.reload(); }, delay);1181 setTimeout(function(){ rcmail.reload(); }, delay); 1176 1182 else if (window.location) 1177 1183 location.href = this.env.comm_path + (this.env.action ? '&_action='+this.env.action : ''); … … 1306 1312 1307 1313 if (this.folder_auto_timer) { 1308 window.clearTimeout(this.folder_auto_timer);1314 clearTimeout(this.folder_auto_timer); 1309 1315 this.folder_auto_timer = null; 1310 1316 this.folder_auto_expand = null; … … 1359 1365 if (div.hasClass('collapsed')) { 1360 1366 if (this.folder_auto_timer) 1361 window.clearTimeout(this.folder_auto_timer);1367 clearTimeout(this.folder_auto_timer); 1362 1368 1363 1369 this.folder_auto_expand = this.env.mailboxes[k].id; 1364 this.folder_auto_timer = window.setTimeout(function() {1370 this.folder_auto_timer = setTimeout(function() { 1365 1371 rcmail.command('collapse-folder', rcmail.folder_auto_expand); 1366 1372 rcmail.drag_start(null); 1367 1373 }, 1000); 1368 1374 } else if (this.folder_auto_timer) { 1369 window.clearTimeout(this.folder_auto_timer);1375 clearTimeout(this.folder_auto_timer); 1370 1376 this.folder_auto_timer = null; 1371 1377 this.folder_auto_expand = null; … … 1519 1525 // start timer for message preview (wait for double click) 1520 1526 if (selected && this.env.contentframe && !list.multi_selecting && !this.dummy_select) 1521 this.preview_timer = window.setTimeout(function(){ ref.msglist_get_preview(); }, 200);1527 this.preview_timer = setTimeout(function(){ ref.msglist_get_preview(); }, 200); 1522 1528 else if (this.env.contentframe) 1523 1529 this.show_contentframe(false); … … 1536 1542 if (this.preview_read_timer) 1537 1543 clearTimeout(this.preview_read_timer); 1538 this.preview_timer = window.setTimeout(function(){ ref.msglist_get_preview(); }, 200);1544 this.preview_timer = setTimeout(function(){ ref.msglist_get_preview(); }, 200); 1539 1545 } 1540 1546 } … … 1805 1811 html = expando; 1806 1812 else if (c == 'subject') { 1807 if (bw.ie) 1813 if (bw.ie) { 1808 1814 col.onmouseover = function() { rcube_webmail.long_subject_title_ie(this, message.depth+1); }; 1815 if (bw.ie8) 1816 tree = '<span></span>' + tree; // #1487821 1817 } 1809 1818 html = tree + cols[c]; 1810 1819 } … … 1917 1926 // mark as read and change mbox unread counter 1918 1927 if (action == 'preview' && this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread && this.env.preview_pane_mark_read >= 0) { 1919 this.preview_read_timer = window.setTimeout(function() {1928 this.preview_read_timer = setTimeout(function() { 1920 1929 ref.set_message(id, 'unread', false); 1921 1930 ref.update_thread_root(id, 'read'); … … 3132 3141 { 3133 3142 if (this.env.draft_autosave) 3134 this.save_timer = se lf.setTimeout(function(){ ref.command("savedraft"); }, this.env.draft_autosave * 1000);3143 this.save_timer = setTimeout(function(){ ref.command("savedraft"); }, this.env.draft_autosave * 1000); 3135 3144 3136 3145 // Unlock interface now that saving is complete … … 3416 3425 this.upload_progress_start = function(action, name) 3417 3426 { 3418 window.setTimeout(function() { rcmail.http_request(action, {_progress: name}); },3427 setTimeout(function() { rcmail.http_request(action, {_progress: name}); }, 3419 3428 this.env.upload_progress_time * 1000); 3420 3429 }; … … 3516 3525 this.display_message(msg, type); 3517 3526 // before redirect we need to wait some time for Chrome (#1486177) 3518 window.setTimeout(function(){ ref.list_mailbox(); }, 500);3527 setTimeout(function(){ ref.list_mailbox(); }, 500); 3519 3528 }; 3520 3529 … … 3574 3583 case 39: // right 3575 3584 if (mod != SHIFT_KEY) 3576 return;3585 return; 3577 3586 } 3578 3587 3579 3588 // start timer 3580 this.ksearch_timer = window.setTimeout(function(){ ref.ksearch_get_results(props); }, 200);3589 this.ksearch_timer = setTimeout(function(){ ref.ksearch_get_results(props); }, 200); 3581 3590 this.ksearch_input = obj; 3582 3591 … … 3886 3895 3887 3896 if (id = list.get_single_selection()) 3888 this.preview_timer = window.setTimeout(function(){ ref.load_contact(id, 'show'); }, 200);3897 this.preview_timer = setTimeout(function(){ ref.load_contact(id, 'show'); }, 200); 3889 3898 else if (this.env.contentframe) 3890 3899 this.show_contentframe(false); … … 5375 5384 // add element and set timeout 5376 5385 this.messages[key].elements.push(id); 5377 window.setTimeout(function() { ref.hide_message(id, type == 'loading'); }, timeout);5386 setTimeout(function() { ref.hide_message(id, type == 'loading'); }, timeout); 5378 5387 return id; 5379 5388 } … … 5393 5402 5394 5403 if (timeout > 0) 5395 window.setTimeout(function() { ref.hide_message(id, type == 'loading'); }, timeout);5404 setTimeout(function() { ref.hide_message(id, type == 'loading'); }, timeout); 5396 5405 return id; 5397 5406 }; -
program/steps/mail/sendmail.inc
r4ffa559 r77799d8 689 689 $mailbody_file = null; 690 690 } 691 692 // raise error if saving failed 693 if (!$saved) { 694 raise_error(array('code' => 800, 'type' => 'imap', 695 'file' => __FILE__, 'line' => __LINE__, 696 'message' => "Could not save message in $store_target"), TRUE, FALSE); 697 698 if ($savedraft) { 699 $OUTPUT->show_message('errorsaving', 'error'); 700 $OUTPUT->send('iframe'); 701 } 691 } 692 693 // raise error if saving failed 694 if (!$saved) { 695 raise_error(array('code' => 800, 'type' => 'imap', 696 'file' => __FILE__, 'line' => __LINE__, 697 'message' => "Could not save message in $store_target"), TRUE, FALSE); 698 699 if ($savedraft) { 700 $OUTPUT->show_message('errorsaving', 'error'); 701 // start the auto-save timer again 702 $OUTPUT->command('auto_save_start'); 703 $OUTPUT->send('iframe'); 702 704 } 703 705 } -
tests/vcards.php
r0fbadeb r77799d8 45 45 46 46 $vcards = rcube_vcard::import($input); 47 47 48 48 $this->assertEqual(2, count($vcards), "Detected 2 vcards"); 49 49 $this->assertEqual("Apple Computer AG", $vcards[0]->displayname, "FN => displayname");
Note: See TracChangeset
for help on using the changeset viewer.
