Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't open file when <svg is inside the file #4679

Closed
3 tasks done
JRH-1997 opened this issue Feb 3, 2023 · 4 comments · Fixed by #4705
Closed
3 tasks done

Can't open file when <svg is inside the file #4679

JRH-1997 opened this issue Feb 3, 2023 · 4 comments · Fixed by #4705
Labels
bug Something that's not working as it's intended to be. ui/ux This issue is related to the User Interface and/or User eXperience

Comments

@JRH-1997
Copy link

JRH-1997 commented Feb 3, 2023

Current Behavior

When someone adds <svg in a file, it is not possible to open it anymore from the file manager.
That's correct handling when it's an SVG file, but not when it's a JS file for example.

This will happen when someone uses the SVG directly inside the code.

Expected Behavior

Be able to open the file from the file manager when it's not a .svg file.

Steps to Reproduce

Create a file
Add somewhere in the file <svg
Save it as test.js
return to the file manager
Try to open the file

Panel Version

1.11.2

Wings Version

1.11.2

Games and/or Eggs Affected

No response

Docker Image

No response

Error Logs

No response

Is there an existing issue for this?

  • I have searched the existing issues before opening this issue.
  • I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
  • I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.
@JRH-1997 JRH-1997 added the not confirmed Report seems plausible but requires additional testing or 3rd part confirmation. label Feb 3, 2023
@devnote-dev
Copy link
Contributor

Can reproduce, although I'm not so sure if this is a bug or intended functionality. Image MIME types are disallowed here, so there's a chance that this is preventing another issue, or it was an oversight.

@matthewpi
Copy link
Member

Can reproduce, although I'm not so sure if this is a bug or intended functionality. Image MIME types are disallowed here, so there's a chance that this is preventing another issue, or it was an oversight.

Binary image formats should be ignored, however text based formats such as SVG should be allowed.

@devnote-dev
Copy link
Contributor

Binary image formats should be ignored, however text based formats such as SVG should be allowed.

The mimetype package used by Wings identifies the file as image/svg+xml which isn't wrong, I guess the panel just needs an additional check for that type.

@JRH-1997
Copy link
Author

JRH-1997 commented Feb 6, 2023

The regex could be updated to: /^image\/(?!svg\+xml)/. It will exclude the image/svg+xml mime type

@matthewpi matthewpi added bug Something that's not working as it's intended to be. ui/ux This issue is related to the User Interface and/or User eXperience and removed not confirmed Report seems plausible but requires additional testing or 3rd part confirmation. labels Feb 23, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in Backlog Feb 23, 2023
@matthewpi matthewpi moved this from 🆕 New to 🧨 Awaiting release in Backlog Feb 23, 2023
@matthewpi matthewpi moved this from 🧨 Awaiting release to 🎉 Released in Backlog Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that's not working as it's intended to be. ui/ux This issue is related to the User Interface and/or User eXperience
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants