Skip to content

Conversation

@mdqst
Copy link

@mdqst mdqst commented Apr 25, 2025

Why?

the current method of using split[1] to extract the file extension fails for filenames containing multiple periods.
this leads to incorrect results, such as extracting cool instead of mp4 from my.cool.video.mp4.

How?

changed the logic to use .pop() on the result of split('.'), ensuring that the last part of the filename is correctly retrieved as the file extension.

Contribution checklist?

  • The commit messages are detailed
  • The build command runs locally
  • Assets or static content are linked and stored in the project
  • Document filename is named after the slug
  • You've reviewed spelling using a grammar checker
  • For documentation, guides or references, you've tested the commands and steps
  • You've done enough research before writing

Security checklist?

  • Sensitive data has been identified and is being protected properly
  • Injection has been prevented (parameterized queries, no eval or system calls)
  • The Components are escaping output (to prevent XSS)

References?

None

@changeset-bot
Copy link

changeset-bot bot commented Apr 25, 2025

⚠️ No Changeset found

Latest commit: 244a3f7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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