Skip to content

fix(dav): honour the write hook veto on legacy chunked uploads [backport 10.16] - #41763

Merged
DeepDiver1975 merged 1 commit into
10.16from
fix/chunked-upload-write-veto-10.16
Jul 29, 2026
Merged

fix(dav): honour the write hook veto on legacy chunked uploads [backport 10.16]#41763
DeepDiver1975 merged 1 commit into
10.16from
fix/chunked-upload-write-veto-10.16

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Backport of #41762 to 10.16.

Summary

Make the legacy WebDAV chunked upload path honour the pre-write hook veto.

createFileChunked() in apps/dav/lib/Connector/Sabre/File.php called
emitPreHooks() but discarded its return value, then assembled the chunks into
the final file unconditionally. As a result the filename blacklist that applies
to ordinary uploads (enforced via the write hook) was not honoured for chunked
uploads — a name that is rejected on the normal PUT path could still be
written through the chunked path.

The chunked assembly now captures the hook result and aborts — unlock the
target, clean up the part files, and throw Forbidden — when a write hook
vetoes the file, mirroring the existing non-chunked put() path.

Changes

  • apps/dav/lib/Connector/Sabre/File.php — honour the emitPreHooks() veto in
    the chunked assembly path.
  • apps/dav/tests/unit/Connector/Sabre/FileTest.php — add
    testChunkedPutToBlacklistedNameIsForbidden(), a regression test that pushes
    a blacklisted name via chunking and asserts it is rejected and never reaches
    the storage backend.

Testing

  • New regression test fails without the fix (the blacklisted file reaches
    storage) and passes with it.
  • Full apps/dav Sabre connector suite: 456 tests, 1698 assertions — green.
  • php-cs-fixer reports no changes.
…ort 10.16]

The legacy WebDAV chunked upload path assembled the final file without
respecting the pre-write hook result, so the filename blacklist that
applies to ordinary uploads was not enforced for chunked uploads. The
chunked assembly now aborts when a write hook vetoes the file, matching
the non-chunked upload path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975
DeepDiver1975 force-pushed the fix/chunked-upload-write-veto-10.16 branch from b5678f3 to 0a326f9 Compare July 29, 2026 14:30
@DeepDiver1975
DeepDiver1975 merged commit 94a21d0 into 10.16 Jul 29, 2026
10 checks passed
@DeepDiver1975
DeepDiver1975 deleted the fix/chunked-upload-write-veto-10.16 branch July 29, 2026 15:21
DeepDiver1975 added a commit that referenced this pull request Jul 29, 2026
Bump version.php to 10.16.4 and materialize the changelog fragments for
this release:

- #41763 honour the write hook veto on legacy chunked WebDAV uploads
- #41574 fix subadmin email change updating caller's address

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
DeepDiver1975 added a commit that referenced this pull request Jul 29, 2026
Forward-port the released 10.16.4 changelog fragments from the 10.16 branch
so master reflects that 10.16.4 has shipped.

- add changelog/10.16.4_2026-07-29/{41574,41763}
- drop changelog/unreleased/41574, which has now been released
- regenerate CHANGELOG.md via calens

changelog/unreleased/41762 is intentionally kept: it is the 11.x-line entry
for the same chunked-upload fix that #41763 backported to 10.16.

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants