Skip to content

Conversation

@danxuliu
Copy link
Member

@danxuliu danxuliu commented Aug 12, 2025

Fixes a regression introduced in #49973 (specifically, in 669e6ca)

array_filter preserves the keys, so after the trusted servers were filtered $server[0] existed only if the server to get was the first one in the original array.

How to test

  • Open the Sharing section in Nextcloud administration settings
  • Add two trusted servers
  • Remove the last one added

Result with this pull request

No errors are logged

Result without this pull request

An error with message Undefined array key 0 at... is logged

"array_filter" preserves the keys, so after the trusted servers were
filtered "$server[0]" existed only if the server to get was the first
one in the original array.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu
Copy link
Member Author

/backport to stable31

@danxuliu danxuliu added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 12, 2025
@danxuliu danxuliu marked this pull request as ready for review August 12, 2025 05:36
@danxuliu danxuliu requested a review from a team as a code owner August 12, 2025 05:36
@danxuliu danxuliu requested review from ArtificialOwl, CarlSchwan and leftybournes and removed request for a team August 12, 2025 05:36
@kesselb kesselb requested review from hamza221 and st3iny August 12, 2025 10:31
Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

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

Ahh, I love arcane PHP behavior ...

@st3iny st3iny merged commit b4302fe into master Aug 12, 2025
210 of 212 checks passed
@st3iny st3iny deleted the fix-getting-trusted-server-other-than-the-first branch August 12, 2025 11:25
@skjnldsv skjnldsv mentioned this pull request Aug 19, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants