Skip to content

Conversation

@SebastianKrupinski
Copy link
Contributor

Back port for #45081

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

@miaulalala miaulalala 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
@solracsf solracsf added this to the Nextcloud 28.0.10 milestone Sep 6, 2024
@solracsf solracsf added the 3. to review Waiting for reviews label Sep 6, 2024
@Altahrim Altahrim mentioned this pull request Sep 11, 2024
8 tasks
@solracsf solracsf force-pushed the backport/45098/stable28 branch from 7c569f1 to 2ac9a1b Compare September 22, 2024 08:53
@Altahrim Altahrim mentioned this pull request Oct 1, 2024
2 tasks
@SebastianKrupinski SebastianKrupinski merged commit 5af3575 into stable28 Oct 2, 2024
@SebastianKrupinski SebastianKrupinski deleted the backport/45098/stable28 branch October 2, 2024 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants