Skip to content

Avoid undefined array key sharing request#59778

Merged
ChristophWurst merged 1 commit intomasterfrom
bug/noid/avoid-undefined-array-key-sharing-request
Apr 22, 2026
Merged

Avoid undefined array key sharing request#59778
ChristophWurst merged 1 commit intomasterfrom
bug/noid/avoid-undefined-array-key-sharing-request

Conversation

@kesselb
Copy link
Copy Markdown
Contributor

@kesselb kesselb commented Apr 21, 2026

Summary

Avoid an undefined array key warning when sending a malformed share request.

I will send a follow up to integrate with config lexicon.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@kesselb kesselb self-assigned this Apr 21, 2026
@kesselb kesselb added the bug label Apr 21, 2026
@kesselb kesselb requested review from a team, SebastianKrupinski and hamza221 as code owners April 21, 2026 09:29
@kesselb kesselb added the 3. to review Waiting for reviews label Apr 21, 2026
@kesselb kesselb requested review from ArtificialOwl, Copilot, icewind1991, leftybournes and salmart-dev and removed request for a team April 21, 2026 09:29
@kesselb
Copy link
Copy Markdown
Contributor Author

kesselb commented Apr 21, 2026

/backport to stable33

@kesselb
Copy link
Copy Markdown
Contributor Author

kesselb commented Apr 21, 2026

/backport to stable32

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR hardens DAV share request handling to avoid undefined array key warnings on malformed XML, and adds per-user rate limiting for share requests.

Changes:

  • Add RateLimiting service and enforce it in the DAV Sharing Plugin POST handler.
  • Validate share requests (must include 1–10 set/remove elements) and reject invalid payloads with BadRequest.
  • Update and expand unit tests for sharing and rate limiting; remove redundant CardDAV sharing plugin test.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
apps/dav/lib/DAV/Sharing/Plugin.php Adds rate-limit enforcement and request validation for share POSTs.
apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php Handles null XML element lists and introduces a constant for the share element QName.
apps/dav/lib/DAV/Security/RateLimiting.php New rate limiting helper for share requests.
apps/dav/lib/Server.php Injects RateLimiting into the sharing plugin for calendars/addressbooks.
apps/dav/tests/unit/DAV/Sharing/PluginTest.php Updates plugin construction and adds tests for invalid share requests.
apps/dav/tests/unit/DAV/Security/RateLimitingTest.php New unit tests for rate limiting behavior.
apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php Removes an older/redundant test.
apps/dav/composer/composer/autoload_static.php Adds classmap entry for the new rate limiting class.
apps/dav/composer/composer/autoload_classmap.php Adds classmap entry for the new rate limiting class.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php
Comment thread apps/dav/lib/Server.php
Comment thread apps/dav/lib/Server.php
Comment thread apps/dav/tests/unit/DAV/Security/RateLimitingTest.php
Comment thread apps/dav/composer/composer/autoload_static.php
AI-assisted: OpenCode (gpt-5.4)

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb kesselb force-pushed the bug/noid/avoid-undefined-array-key-sharing-request branch from f766153 to 055bd5c Compare April 21, 2026 13:32
@ChristophWurst ChristophWurst merged commit e1049a8 into master Apr 22, 2026
189 of 194 checks passed
@ChristophWurst ChristophWurst deleted the bug/noid/avoid-undefined-array-key-sharing-request branch April 22, 2026 10:32
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 bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants