Skip to content

[stable28] fix(caldav): Do not load IMipPlugin before user auth and session is c… - #47791

Merged
SebastianKrupinski merged 1 commit into
stable28from
backport/45098/stable28
Oct 2, 2024
Merged

[stable28] fix(caldav): Do not load IMipPlugin before user auth and session is c…#47791
SebastianKrupinski merged 1 commit into
stable28from
backport/45098/stable28

Conversation

@SebastianKrupinski

Copy link
Copy Markdown
Contributor

Back port for #45081

Do not load IMipPlugin before user is authenticated and user session is initialized

@miaulalalamiaulalala changed the title fix(caldav): Do not load IMipPlugin before user auth and session is c…[stable28] fix(caldav): Do not load IMipPlugin before user auth and session is c…Sep 5, 2024
$senderName = $this->userManager->getDisplayName($this->userId);
// Due to a bug in sabre, the senderName property for an iTIP message can actually also be a VObject Property
// If the iTIP message senderName is null or empty use the user session name as the senderName
if (($iTipMessage->senderName instanceof Parameter) && !empty(trim($iTipMessage->senderName->getValue()))) {

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 1 of trim cannot be null, possibly null value provided
// Due to a bug in sabre, the senderName property for an iTIP message can actually also be a VObject Property
// If the iTIP message senderName is null or empty use the user session name as the senderName
if (($iTipMessage->senderName instanceof Parameter) && !empty(trim($iTipMessage->senderName->getValue()))) {
$senderName = trim($iTipMessage->senderName->getValue());

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 1 of trim cannot be null, possibly null value provided
} elseif (is_string($iTipMessage->senderName) && !empty(trim($iTipMessage->senderName))) {
$senderName = trim($iTipMessage->senderName);
} elseif ($this->userSession->getUser() !== null) {
$senderName = trim($this->userSession->getUser()->getDisplayName());

Check notice

Code scanning / Psalm

PossiblyNullReference

Cannot call method getDisplayName on possibly null value

// calendar plugins
if ($this->requestIsForSubtree(['calendars', 'public-calendars', 'system-calendars', 'principals'])) {
$this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest(), \OC::$server->getConfig()));

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\Server::getRequest has been marked as deprecated

// calendar plugins
if ($this->requestIsForSubtree(['calendars', 'public-calendars', 'system-calendars', 'principals'])) {
$this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest(), \OC::$server->getConfig()));

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\Server::getConfig has been marked as deprecated
\OC::$server->getCommentsManager(),
$userSession
));
if (\OC::$server->getConfig()->getAppValue('dav', 'sendInvitations', 'yes') === 'yes') {

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\Server::getConfig has been marked as deprecated
@solracsfsolracsf added this to the Nextcloud 28.0.10 milestone Sep 6, 2024
@solracsfsolracsf added the 3. to review Waiting for reviews label Sep 6, 2024
@AltahrimAltahrim mentioned this pull request Sep 11, 2024
8 tasks
…reated
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
@solracsf
solracsfforce-pushed the backport/45098/stable28 branch from 7c569f1 to 2ac9a1bCompareSeptember 22, 2024 08:53
@AltahrimAltahrim mentioned this pull request Oct 1, 2024
2 tasks
@SebastianKrupinski
SebastianKrupinski merged commit 5af3575 into stable28Oct 2, 2024
@SebastianKrupinski
SebastianKrupinski deleted the backport/45098/stable28 branch October 2, 2024 06:09
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@SebastianKrupinski@miaulalala@solracsf@github-advanced-security