Skip to content

Commit 5895f1a

Browse files
committed
[smarcet]
* fixes for icloud imp
1 parent f234d53 commit 5895f1a

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/Facade/CalDavClient.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ public function getUserPrincipal()
229229
RequestFactory::createPropFindRequest
230230
(
231231
$this->server_url,
232-
CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::PrincipalRequestType)->getContent()
232+
CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::PrincipalRequestType)->getContent(),
233+
0
233234
)
234235
);
235236

@@ -247,7 +248,8 @@ public function getCalendarHome($principal_url)
247248
RequestFactory::createPropFindRequest
248249
(
249250
$principal_url,
250-
CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarHomeRequestType)->getContent()
251+
CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarHomeRequestType)->getContent(),
252+
0
251253
)
252254
);
253255

src/Facade/Responses/UserPrincipalSingleResponse.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ final class UserPrincipalSingleResponse extends GenericSinglePROPFINDCalDAVRespo
2222
* @return string
2323
*/
2424
public function getPrincipalUrl() {
25-
return isset($this->found_props['current-user-principal']) && isset($this->found_props['current-user-principal']['href']) ?
25+
$url = isset($this->found_props['current-user-principal']) && isset($this->found_props['current-user-principal']['href']) ?
2626
$this->server_url.$this->found_props['current-user-principal']['href'] : null;
27+
// check on not found one ( issue on caldav icloud imp)
28+
if(empty($url))
29+
$url = isset($this->not_found_props['current-user-principal']) && isset($this->not_found_props['current-user-principal']['href']) ?
30+
$this->server_url.$this->not_found_props['current-user-principal']['href'] : null;
31+
return $url;
2732
}
2833
}

0 commit comments

Comments
 (0)