Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sharing and around three errors related to Undefined array key "CLOUD" #40208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

klondi
Copy link

@klondi klondi commented Sep 1, 2023

Summary

We try to access $contact['CLOUD'] when it might not be set. As a consequence of that 3 PHP errors are generated the last one being an uncaught exception that makes it impossible to share files locally.

This patch adds a simple check to ensure the value exists before using it.

Please backport this to stable 26 too as it also has the same issue.

Checklist

…LOUD"

We try to access $contact['CLOUD'] when it might not be set. As a consequence of that 3 PHP errors are generated the last one being an uncaught exception that makes it impossible to share files locally.

This patch adds a simple check to ensure the value exists before using it.

Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <[email protected]>
@klondi
Copy link
Author

klondi commented Sep 1, 2023

For more details this seems to be triggered by the LDAP Contacts Backend as the contacts returned do not (for obvious reasons) have a CLOUD parameter.

@joshtrichards
Copy link
Member

Is this associated with an open Issue?

@@ -186,7 +186,7 @@ public function search($search, $limit, $offset, ISearchResult $searchResult) {
return false;
}

if ($this->shareeEnumeration) {
if ($this->shareeEnumeration && isset($contact['CLOUD'])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: Please add the check on the condition line 164 as well.

@solracsf solracsf added this to the Nextcloud 28 milestone Nov 21, 2023
@blizzz blizzz mentioned this pull request Nov 22, 2023
5 tasks
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
This was referenced Mar 12, 2024
This was referenced Mar 20, 2024
@skjnldsv skjnldsv mentioned this pull request Mar 28, 2024
81 tasks
@skjnldsv skjnldsv modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
@skjnldsv skjnldsv added 2. developing Work in progress stale Ticket or PR with no recent activity and removed 3. to review Waiting for reviews labels Jul 27, 2024
This was referenced Jul 30, 2024
This was referenced Aug 5, 2024
@skjnldsv skjnldsv mentioned this pull request Aug 13, 2024
@skjnldsv skjnldsv removed this from the Nextcloud 30 milestone Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress backport-request stale Ticket or PR with no recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants