Skip to content

Fix file name generation for uploaded images - #120

Open
rdy4ever wants to merge 1 commit into
PrestaShop:devfrom
rdy4ever:fix_wrong_filenames
Open

Fix file name generation for uploaded images#120
rdy4ever wants to merge 1 commit into
PrestaShop:devfrom
rdy4ever:fix_wrong_filenames

Conversation

@rdy4ever

Copy link
Copy Markdown
Questions Answers
Description? In the latest version of the module, newly uploaded slides (for example, after upgrade) have wrong file names (double extension concatenated in the name and no dot to separate it - for example: 48fef018a667ee0b10f9d4da0c619f8186a00f5test_namejpgjpg). This PR fixes the file name generation.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes #119
How to test? Upload new images and see that now the file names are correct

@ps-jarvis

Copy link
Copy Markdown

Hello @rdy4ever!

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

Thank you, and welcome to this Open Source community!

@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard Jan 28, 2026
@Touxten Touxten closed this Feb 25, 2026
@github-project-automation github-project-automation Bot moved this from Ready for review to Closed in PR Dashboard Feb 25, 2026
@ps-jarvis ps-jarvis moved this from Closed to Ready for review in PR Dashboard Feb 25, 2026
@Touxten Touxten reopened this Feb 25, 2026
@github-project-automation github-project-automation Bot moved this from Ready for review to Reopened in PR Dashboard Feb 25, 2026
@boo-code

Copy link
Copy Markdown

QA — verified ✅

Reproduced the filename generation on ps_imageslider.php and confirmed the fix, using Tools::str2url/pathinfo exactly as on the touched line:

input filename before after (this PR)
My Test.JPG my-testjpgjpg my-test.jpg

Before, str2url($name) . $type stripped the dot out of the original name and then concatenated the extension again, producing a double, dotless extension. pathinfo($name, PATHINFO_FILENAME) drops the original extension first, and the explicit '.' restores the separator, so the result is a single, correct name.ext.

This also resolves #126 (same line, "saved without a dot/extension") — they're the same bug, so #126 can be closed as a duplicate of #119 once this is merged. LGTM.

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

Labels

None yet

Projects

Status: Reopened

Development

Successfully merging this pull request may close these issues.

[BUG] Wrong file names for new slides

5 participants