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

Image name is not sanitized, corrupting XML #98

Open
JbIPS opened this issue Jan 22, 2023 · 0 comments
Open

Image name is not sanitized, corrupting XML #98

JbIPS opened this issue Jan 22, 2023 · 0 comments

Comments

@JbIPS
Copy link

JbIPS commented Jan 22, 2023

Hi,

I just tried to create a dynamic wallpaper and I constantly got a corrupted file after save ('Corrupted file' error message on re-open).

After some investigation, I noticed that the culprit is an image with a & in its name. Opening the resulting XML, I saw the & is not escaped, thus creating a corrupted XML file.

I think you need an escape mechanism (maybe just xml.sax.saxutils.escape(data, entities={})) when exporting to XML. And of course, unescape on load.

I don't know if it has some border effects but if you think it's OK, I can provide a PR.

Thank you for this editor!

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

No branches or pull requests

1 participant