File tree Expand file tree Collapse file tree 4 files changed +398
-0
lines changed
lib/Sabre/VObject/Property Expand file tree Collapse file tree 4 files changed +398
-0
lines changed Original file line number Diff line number Diff line change 1919 * Added: --forgiving option to vobject utility.
2020 * Fixed: Compound properties such as ADR were not correctly split up in
2121 vCard 2.1 quoted printable-encoded properties.
22+ * Fixed: Issue 64: Encoding of binary properties of converted vCards.
23+ Thanks @DominikTo for the patch.
2224
23253.1.2-stable (2013-08-13)
2426 * Fixed: Setting correct property group on VCard conversion
Original file line number Diff line number Diff line change @@ -30,6 +30,32 @@ class Binary extends Property {
3030 */
3131 public $ delimiter = null ;
3232
33+ /**
34+ * Updates the current value.
35+ *
36+ * This may be either a single, or multiple strings in an array.
37+ *
38+ * @param string|array $value
39+ * @return void
40+ */
41+ public function setValue ($ value ) {
42+
43+ if (is_array ($ value )) {
44+
45+ if (count ($ value ) === 1 ) {
46+ $ this ->value = $ value [0 ];
47+ } else {
48+ throw new \InvalidArgumentException ('The argument must either be a string or an array with only one child ' );
49+ }
50+
51+ } else {
52+
53+ $ this ->value = $ value ;
54+
55+ }
56+
57+ }
58+
3359 /**
3460 * Sets a raw value coming from a mimedir (iCalendar/vCard) file.
3561 *
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Sabre \VObject ;
4+
5+ class Issue64Test extends \PHPUnit_Framework_TestCase {
6+
7+ function testRead () {
8+
9+ $ vcard = Reader::read (file_get_contents (dirname (__FILE__ ) . '/issue64.vcf ' ));
10+ $ vcard = $ vcard ->convert (\Sabre \VObject \Document::VCARD30 );
11+ $ vcard = $ vcard ->serialize ();
12+
13+ $ converted = Reader::read ($ vcard );
14+
15+ $ this ->assertInstanceOf ('Sabre \\VObject \\Component \\VCard ' , $ converted );
16+
17+ }
18+
19+ }
You can’t perform that action at this time.
0 commit comments