Skip to content

Fix/objectstore fopen basename ext - #64770

Open
Bytepie wants to merge 3 commits into
nextcloud:masterfrom
Bytepie:fix/objectstore-fopen-basename-ext
Open

Bytepie wants to merge 3 commits into
nextcloud:masterfrom
Bytepie:fix/objectstore-fopen-basename-ext

Conversation

@Bytepie

@Bytepie Bytepie commented Sep 25, 2026

Copy link
Copy Markdown

Summary

Fixes an issue in ObjectStoreStorage::fopen() where the file extension is extracted using strrpos($path, '.') across the entire relative path instead of basename($path).

Problem

When an extensionless file is located inside a folder containing a dot that is 0. Projects/Subfolder/hit), $ext is assigned the entire subpath string after the dot.

Solution

  1. Use basename($path) when extracting the file extension

Tests

Tested against live Nextcloud container where I had this issue during migration of data from GlusterFS to S3 (Ceph), and verified with PHPUnit in nextcloud-docker-dev environment.

Checklist

AI (if applicable)

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

@Bytepie
Bytepie requested a review from a team as a code owner September 25, 2026 18:25
@Bytepie
Bytepie requested review from leftybournes, provokateurin, salmart-dev and sorbaugh and removed request for a team September 25, 2026 18:25

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant