Changeset 6124 in subversion
- Timestamp:
- Apr 24, 2012 3:27:54 PM (13 months ago)
- Location:
- branches/release-0.8
- Files:
-
- 3 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_vcard.php (modified) (5 diffs)
-
program/steps/mail/sendmail.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-0.8/CHANGELOG
r6119 r6124 2 2 =========================== 3 3 4 - Fix importing vCard photo with ENCODING param specified (#1488432) 4 5 - Support mutliple name/email pairs for Bcc and Reply-To identity settings (#1488445) 5 6 - Fix parent folder permissions checking on folder creation (#1488443) -
branches/release-0.8/program/include/rcube_vcard.php
r5787 r6124 296 296 if (strpos($value, 'http:') === 0) { 297 297 // TODO: fetch file from URL and save it locally? 298 $this->raw['PHOTO'][0] = array(0 => $value, ' URL' => true);298 $this->raw['PHOTO'][0] = array(0 => $value, 'url' => true); 299 299 } 300 300 else { 301 $encoded = !preg_match('![^a-z0-9/=+-]!i', $value); 302 $this->raw['PHOTO'][0] = array(0 => $encoded ? $value : base64_encode($value), 'BASE64' => true); 301 $this->raw['PHOTO'][0] = array(0 => $value, 'base64' => (bool) preg_match('![^a-z0-9/=+-]!i', $value)); 303 302 } 304 303 break; … … 553 552 $entry = array(); 554 553 $field = strtoupper($regs2[1][0]); 554 $enc = null; 555 555 556 556 foreach($regs2[1] as $attrid => $attr) { … … 559 559 if ($key == 'ENCODING') { 560 560 // add next line(s) to value string if QP line end detected 561 while ($value == 'QUOTED-PRINTABLE' && preg_match('/=$/', $lines[$i])) 561 if ($value == 'QUOTED-PRINTABLE') { 562 while (preg_match('/=$/', $lines[$i])) 562 563 $line[2] .= "\n" . $lines[++$i]; 563 564 $ line[2] = self::decode_value($line[2], $value);564 } 565 $enc = $value; 565 566 } 566 else 567 $entry[strtolower($key)] = array_merge((array)$entry[strtolower($key)], (array)self::vcard_unquote($value, ',')); 567 else { 568 $lc_key = strtolower($key); 569 $entry[$lc_key] = array_merge((array)$entry[$lc_key], (array)self::vcard_unquote($value, ',')); 570 } 568 571 } 569 572 else if ($attrid > 0) { 570 $entry[ $key] = true; // true means attr without =value573 $entry[strtolower($key)] = true; // true means attr without =value 571 574 } 572 575 } 573 576 574 $entry = array_merge($entry, (array)self::vcard_unquote($line[2])); 577 // decode value 578 if ($enc || !empty($entry['base64'])) { 579 // save encoding type (#1488432) 580 if ($enc == 'B') { 581 $entry['encoding'] = 'B'; 582 // should we use vCard 3.0 instead? 583 // $entry['base64'] = true; 584 } 585 $line[2] = self::decode_value($line[2], $enc ? $enc : 'base64'); 586 } 587 588 if ($enc != 'B' && empty($entry['base64'])) { 589 $line[2] = self::vcard_unquote($line[2]); 590 } 591 592 $entry = array_merge($entry, (array) $line[2]); 575 593 $data[$field][] = $entry; 576 594 } … … 597 615 598 616 case 'base64': 617 case 'b': 599 618 self::$values_decoded = true; 600 619 return base64_decode($value); … … 628 647 $value = array(); 629 648 foreach($entry as $attrname => $attrvalues) { 630 if (is_int($attrname)) 649 if (is_int($attrname)) { 650 if (!empty($entry['base64']) || $entry['encoding'] == 'B') { 651 $attrvalues = base64_encode($attrvalues); 652 } 631 653 $value[] = $attrvalues; 632 elseif ($attrvalues === true) 633 $attr .= ";$attrname"; // true means just tag, not tag=value, as in PHOTO;BASE64:... 654 } 655 else if (is_bool($attrvalues)) { 656 if ($attrvalues) { 657 $attr .= strtoupper(";$attrname"); // true means just tag, not tag=value, as in PHOTO;BASE64:... 658 } 659 } 634 660 else { 635 661 foreach((array)$attrvalues as $attrvalue) 636 $attr .= ";$attrname=". self::vcard_quote($attrvalue, ',');662 $attr .= strtoupper(";$attrname=") . self::vcard_quote($attrvalue, ','); 637 663 } 638 664 } -
branches/release-0.8/program/steps/mail/sendmail.inc
r5945 r6124 699 699 $mailbody_file = null; 700 700 } 701 702 // raise error if saving failed 703 if (!$saved) { 704 raise_error(array('code' => 800, 'type' => 'imap', 705 'file' => __FILE__, 'line' => __LINE__, 706 'message' => "Could not save message in $store_target"), TRUE, FALSE); 707 708 if ($savedraft) { 709 $OUTPUT->show_message('errorsaving', 'error'); 710 $OUTPUT->send('iframe'); 711 } 701 } 702 703 // raise error if saving failed 704 if (!$saved) { 705 raise_error(array('code' => 800, 'type' => 'imap', 706 'file' => __FILE__, 'line' => __LINE__, 707 'message' => "Could not save message in $store_target"), TRUE, FALSE); 708 709 if ($savedraft) { 710 $OUTPUT->show_message('errorsaving', 'error'); 711 // start the auto-save timer again 712 $OUTPUT->command('auto_save_start'); 713 $OUTPUT->send('iframe'); 712 714 } 713 715 }
Note: See TracChangeset
for help on using the changeset viewer.
