Skip to content

Commit 7ffa256

Browse files
Merge pull request #54652 from nextcloud/backport/54650/stable31
[stable31] fix(carddav): IAddressBook::getKey() should return a string
2 parents 3cc15e3 + 06ab1f2 commit 7ffa256

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

apps/dav/lib/CardDAV/AddressBookImpl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(
4141
* @since 5.0.0
4242
*/
4343
public function getKey() {
44-
return $this->addressBookInfo['id'];
44+
return (string)$this->addressBookInfo['id'];
4545
}
4646

4747
/**

apps/dav/tests/unit/CardDAV/AddressBookImplTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ protected function setUp(): void {
6767
}
6868

6969
public function testGetKey(): void {
70-
$this->assertSame($this->addressBookInfo['id'],
70+
$this->assertIsString($this->addressBookImpl->getKey());
71+
$this->assertSame((string)$this->addressBookInfo['id'],
7172
$this->addressBookImpl->getKey());
7273
}
7374

0 commit comments

Comments
 (0)