Don't attempt to parse the DTD for Plist files - #31
Conversation
|
@LordMike Can you take a look at this? Thanks! |
so just passing a new instance of
If I'm correct, your change would introduce a compiler warning.
I guess this is what you intended for .NET > 4.0. (I haven't tested this and the linked documentation mentions only a beta version, so this might be incorrect.) |
|
Totally forgot about this one. Will we ever encounter PList files that use custom entities? Would it be better to let DtdProcessing be an option the user sets, through some settings object? |
|
@zivillian I perhaps misunderstood your comment; but this PR is not changing the value of |
I'm fairly sure that we will never encounter a Plist file with custom entities. Plist files can be serialized in various formats, XML being one of them. Plist doesn't have the notion of entities so you will not see any entities in the XML files generated by XML.
Basically, on .NET 4.0 and above (this includes Core), |
|
@LordMike @zivillian Back from vacation, rebased the PR, the build now passes, let me know if this is good to go. |
|
@qmfrederik It looks like I've misread your code - judging the comments and the changes this should be fine. |
|
@qmfrederik put a note in the ifdef where you set the DtdIgnore property explaining that i MUST be set to Ignore on anything by net20. Then it should be good to go. |
|
|
||
| XmlReaderSettings settings = new XmlReaderSettings(); | ||
| #if !NET20 | ||
| settings.DtdProcessing = DtdProcessing.Ignore; |
There was a problem hiding this comment.
Put a note here, explaining that i MUST be set to Ignore on anything by net20. Then it should be good to go.
|
@LordMike Should be good to go now ;-) |
The
Plistclass parses Apple Property List files. These files come with a DTD declaration.DTD processing is now prohibited by default in .NET 4.0 and above, but is still enabled (requested) unless you explicitly disable it. This would result in an exception when parsing property list files (for example, when opening DMG images).
This PR disables DTD processing alltogether and adds a unit test for the property list parsing code.