Skip to content

Conversation

@vitormattos
Copy link
Member

No description provided.

When a document is sent from Files app with the extension already
in the name (e.g., 'test.pdf'), it was being stored as is and would
later display with duplicate extension ('test.pdf.pdf').

This commit adds a method to remove the extension from the document
name before saving if it matches the extension stored in metadata.
The removal is case-insensitive to handle .pdf, .PDF, .Pdf, etc.

Signed-off-by: Vitor Mattos <[email protected]>
Apply the same extension removal logic when formatting file list
responses. This ensures that files displayed in the list view don't
show duplicate extensions (e.g., 'test.pdf.pdf').

The method checks the metadata for the file extension and removes
it from the name if present, maintaining consistency with the save
operation.

Signed-off-by: Vitor Mattos <[email protected]>
@vitormattos vitormattos added this to the Next Major (33) milestone Dec 3, 2025
@vitormattos vitormattos self-assigned this Dec 3, 2025
@github-project-automation github-project-automation bot moved this to 0. Needs triage in Roadmap Dec 3, 2025
Fix Psalm errors by handling the case where preg_replace might
return null. Use null coalescing operator to fallback to the
original name if preg_replace fails.

Signed-off-by: Vitor Mattos <[email protected]>
@vitormattos
Copy link
Member Author

/backport to stable32

@vitormattos
Copy link
Member Author

/backport to stable31

@vitormattos vitormattos merged commit 614bbd4 into main Dec 3, 2025
65 checks passed
@vitormattos vitormattos deleted the fix/remove-duplicate-extension branch December 3, 2025 04:32
@github-project-automation github-project-automation bot moved this from 0. Needs triage to 4. to release in Roadmap Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 4. to release

Development

Successfully merging this pull request may close these issues.

2 participants