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

Prevent undefined offset 0 in findByUserIdOrMail #16308

Merged
merged 1 commit into from
Jul 10, 2019

Conversation

kesselb
Copy link
Contributor

@kesselb kesselb commented Jul 9, 2019

Fix a regression introduced by #10743

Discovered by @compagnon #16260

array_filter presevers the keys. If the first user is disabled and the second one enabled count will be 1 but index 0 undefined. Adjusted the tests to call findByUserIdOrMail directly because the email method catches any error and returns always success.

@kesselb kesselb added 3. to review Waiting for reviews regression labels Jul 9, 2019
@kesselb kesselb changed the title Reset array with array_values Prevent undefined offset 0 in findByUserIdOrMail Jul 9, 2019
@kesselb kesselb force-pushed the fix/undefined-offset-0 branch from 7650049 to a3689b9 Compare July 9, 2019 10:33
@kesselb kesselb force-pushed the fix/undefined-offset-0 branch from a3689b9 to 1ce7d7a Compare July 9, 2019 12:14
@MorrisJobke MorrisJobke added this to the Nextcloud 17 milestone Jul 9, 2019
@kesselb kesselb force-pushed the fix/undefined-offset-0 branch from 1ce7d7a to 1bdf63a Compare July 9, 2019 17:26
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb kesselb force-pushed the fix/undefined-offset-0 branch from 1bdf63a to d57540a Compare July 9, 2019 17:29
Copy link
Contributor

@compagnon compagnon left a comment

Choose a reason for hiding this comment

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

merged into #16260

@MorrisJobke
Copy link
Member

/backport to stable16

@MorrisJobke
Copy link
Member

/backport to stable15

Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

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

Make sense!

@MorrisJobke MorrisJobke merged commit 5c21b29 into master Jul 10, 2019
@MorrisJobke MorrisJobke deleted the fix/undefined-offset-0 branch July 10, 2019 10:16
@backportbot-nextcloud
Copy link

backport to stable16 in #16325

@MorrisJobke
Copy link
Member

/backport to stable15

@backportbot-nextcloud
Copy link

backport to stable15 in #16326

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 regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants