Skip to content

Commit 781f006

Browse files
committed
Fix PHP warning
1 parent c891966 commit 781f006

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

program/lib/Roundcube/rcube_vcard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public function get_assoc()
231231
&& !in_array($k, ['pref', 'internet', 'voice', 'base64'])
232232
) {
233233
$k_uc = strtoupper($k);
234-
$subtype = $typemap[$k_uc] ?: $k;
234+
$subtype = !empty($typemap[$k_uc]) ? $typemap[$k_uc] : $k;
235235
break;
236236
}
237237
}

tests/Framework/VCardTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ public function test_parse_two()
3232
$this->assertSame('roundcube.net', $vcard->organization, 'Test organization field');
3333
$this->assertCount(2, $vcard->email, 'List two e-mail addresses');
3434
$this->assertSame('roundcube@gmail.com', $vcard->email[0], 'Use PREF e-mail as primary');
35+
36+
$contact = $vcard->get_assoc();
37+
$this->assertSame('The notes...', $contact['notes'][0]);
3538
}
3639

3740
/**

0 commit comments

Comments
 (0)