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

The document type "..." is not allowed #427

Closed
crazycodr opened this issue Apr 14, 2015 · 0 comments
Closed

The document type "..." is not allowed #427

crazycodr opened this issue Apr 14, 2015 · 0 comments

Comments

@crazycodr
Copy link

I've just forked the serializer to find out that the tests are not passing. There seems to be a failure and an error which are both related to the inner entity in the doctype.

Tests failing are:

  • JMS\Serializer\Tests\Serializer\XmlSerializationTest::testWhitelistedDocumentTypesAreAllowed
  • JMS\Serializer\Tests\Serializer\XmlSerializationTest::testExternalEntitiesAreDisabledByDefault

After an hour or so studying the code, i came to conclusion that the code is fine and the tests are the problem. In both tests, we expect the doctype to be:

<!DOCTYPE author [<!ENTITY foo SYSTEM "php://filter/read=convert.base64-encode/resource='.basename(__FILE__).'">]>

While, the doctype resolves to the internalSubset instead of the whole DocType. So the value that becomes expected should be:

<!ENTITY foo SYSTEM "php://filter/read=convert.base64-encode/resource='.basename(__FILE__).'">

Now, i'm not a super fan of XML but i'm pretty sure the code actually works. Can anyone confirm that the tests are really incorrect? If so, i'll PR with the fix asap.

Thanks

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 a pull request may close this issue.

1 participant