end2endzone / ShellAnything

ShellAnything is a C++ open-source software which allow one to easily customize and add new options to *Windows Explorer* context menu. Define specific actions when a user right-click on a file or a directory.
MIT License
183 stars 27 forks source link

Comment inside XML #80

Closed GasDauMin closed 3 years ago

GasDauMin commented 3 years ago

I'am trying to add comment inside the document, at the begining of document and when coment reach some amount of bits it is not loaded at all.

image

After some time of reviewing, I found a problematic method Configuration::IsValidConfigFile it peeks only small portion of configuration file and that portion may not cover important tags like root, shell, or menu.

image

I thinking maybe it would be better to do check with XML parse tools?

end2endzone commented 3 years ago

Outch. I knew that using -- in xml comments might be bad. I had issues with some software (like visual studio) but since TinyXML (the xml parser used by ShellAnything) was not having issues with these characters, I though it was parser-specific and not something documented in the xml format. Good catch.

The function was first introduced here and then it was moved to Configuration class in commit facb33c96e05a144c113f8d099a0f56faf7ee20d and renamed with a capical "I" in commit 2c74f0c0e19a1f77d3e1a43711e676e4a68d9dc7.

In other words: this issue is not linked to a specific issue. I can't remember why I first peeked into the file to know if it was properly formatted instead of directly using an xml parser.