Skip to content

Commit

Permalink
Merge pull request #131 from wadmiraal/master
Browse files Browse the repository at this point in the history
Fix folding mentioned in #95
  • Loading branch information
jeroendesloovere authored Jul 4, 2018
2 parents 89f203e + f189848 commit 6f4627d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/VCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ protected function fold($text)
}

// split, wrap and trim trailing separator
return substr($this->chunk_split_unicode($text, 73, "\r\n "), 0, -3);
return substr($this->chunk_split_unicode($text, 75, "\r\n "), 0, -3);
}

/**
Expand Down
13 changes: 12 additions & 1 deletion tests/VCardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,18 @@ public function tearDown()

public function testAddAddress()
{
$this->assertEquals($this->vcard, $this->vcard->addAddress());
$this->assertEquals($this->vcard, $this->vcard->addAddress(
'',
'88th Floor',
'555 East Flours Street',
'Los Angeles',
'CA',
'55555',
'USA'
));
$this->assertContains('ADR;WORK;POSTAL;CHARSET=utf-8:;88th Floor;555 East Flours Street;Los Angele', $this->vcard->getOutput());
// Should fold on row 75, so we should not see the full address.
$this->assertNotContains('ADR;WORK;POSTAL;CHARSET=utf-8:;88th Floor;555 East Flours Street;Los Angeles;CA;55555;', $this->vcard->getOutput());
}

public function testAddBirthday()
Expand Down

0 comments on commit 6f4627d

Please sign in to comment.