Skip to content

fix(UpdateNotifications): Handle numeric user ids - #44093

Closed
joshtrichards wants to merge 1 commit into
masterfrom
fix/updatenotifications/numeric-ids-master
Closed

fix(UpdateNotifications): Handle numeric user ids#44093
joshtrichards wants to merge 1 commit into
masterfrom
fix/updatenotifications/numeric-ids-master

Conversation

@joshtrichards

Copy link
Copy Markdown
Member

Summary

getUsersToNotify() uses array_key so when $uid happens to be numeric it ends up needing to be cast here (similar to #15912).

Backports will need to be done manually due to restructure that occurred in >v28 (I'll follow-up with those).

TODO

  • ...

Checklist

Closes#44051 Signed-off-by: Josh <josh.t.richards@gmail.com>

foreach ($this->getUsersToNotify() as $uid) {
$notification->setUser($uid);
$notification->setUser((string) $uid);

Check notice

Code scanning / Psalm

RedundantCastGivenDocblockType

Redundant cast to string given docblock-provided type

foreach ($this->getUsersToNotify() as $uid) {
$notification->setUser($uid);
$notification->setUser((string) $uid);

Check notice

Code scanning / Psalm

RedundantCastGivenDocblockType

Redundant cast to string given docblock-provided type
joshtrichards added a commit that referenced this pull request Mar 8, 2024
manual backport of #44093 to fix#44051 for <=v28
Signed-off-by: Josh <josh.t.richards@gmail.com>
@susnux

Copy link
Copy Markdown
Contributor

getUsersToNotify() uses array_key

This is no longer the case, array_unique and array_values are used.

@nickvergessen

Copy link
Copy Markdown
Member

28 and lower with the bug is fixed via #44095

@nickvergessen
nickvergessen deleted the fix/updatenotifications/numeric-ids-master branch March 8, 2024 22:15
backportbotBot pushed a commit that referenced this pull request Mar 8, 2024
manual backport of #44093 to fix#44051 for <=v28
Signed-off-by: Josh <josh.t.richards@gmail.com>
backportbotBot pushed a commit that referenced this pull request Mar 8, 2024
manual backport of #44093 to fix#44051 for <=v28
Signed-off-by: Josh <josh.t.richards@gmail.com>
joshtrichards added a commit that referenced this pull request Mar 10, 2024
manual backport of #44093 to fix#44051 for <=v28
Signed-off-by: Josh <josh.t.richards@gmail.com>
joshtrichards added a commit that referenced this pull request Mar 12, 2024
manual backport of #44093 to fix#44051 for <=v28
Signed-off-by: Josh <josh.t.richards@gmail.com>
@skjnldsvskjnldsv removed this from the Nextcloud 29 milestone Aug 14, 2024
Sign up for freeto 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.

[Bug]: Nummeric user id breaks updatenotifications

5 participants

@joshtrichards@susnux@nickvergessen@github-advanced-security@skjnldsv