Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Enhance invoice filename safety by sanitizing number#41457

Open
Maofree wants to merge 1 commit into
PrestaShop:9.1.xfrom
Maofree:patch-1
Open

Enhance invoice filename safety by sanitizing number#41457
Maofree wants to merge 1 commit into
PrestaShop:9.1.xfrom
Maofree:patch-1

Conversation

@Maofree
Copy link
Copy Markdown

@Maofree Maofree commented May 12, 2026

Replace invoice number formatting to ensure safety by replacing slashes with dashes. For the file name, it is necessary to sanitize the result

Questions Answers
Branch? 9.1.x
Description? Fix bug in invoice PDF filename generation when PS_INVOICE_USE_YEAR is enabled. The filename could contain a slash (/), causing the browser/filesystem to keep only the last segment and produce names like 2026.pdf instead of the full invoice code.
Type? bug fix
Category? BO
BC breaks? no
Deprecations? no
How to test? 1. Enable PS_INVOICE_USE_YEAR in invoice settings. 2. Generate an invoice PDF. 3. Verify the downloaded filename contains prefix, invoice number, and year (for example PREFIX000001-2026.pdf) instead of just 2026.pdf. 4. Confirm the invoice number displayed inside the PDF remains correct.
UI Tests Not applicable / not required for this backend PDF filename fix
Fixed issue or discussion? Fixes #41436
Related PRs -
Sponsor company MaoDev

Replace invoice number formatting to ensure safety by replacing slashes with dashes. For the file name, it is necessary to sanitize the result
@Maofree Maofree requested a review from a team as a code owner May 12, 2026 12:22
@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard May 12, 2026
@ps-jarvis ps-jarvis added Bug fix Type: Bug fix 9.1.x Branch labels May 12, 2026
@ps-jarvis
Copy link
Copy Markdown

Hello @Maofree!

This is your first pull request on PrestaShop repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

@ps-jarvis ps-jarvis moved this from Ready for review to Need 2nd approval in PR Dashboard May 16, 2026
@ps-jarvis ps-jarvis added the Waiting for QA Status: action required, waiting for test feedback label May 17, 2026
@ps-jarvis ps-jarvis moved this from Need 2nd approval to To be tested in PR Dashboard May 17, 2026
@Progi1984 Progi1984 modified the milestones: 9.1.3, 9.1.4 May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

9.1.x Branch Bug fix Type: Bug fix Waiting for QA Status: action required, waiting for test feedback

Projects

Status: To be tested

Development

Successfully merging this pull request may close these issues.

5 participants