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

Fix #51903: simplexml_load_file() doesn't use HTTP headers #6747

Closed
wants to merge 3 commits into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Mar 2, 2021

The encoding attribute of the XML declaration is optional; it is good
practice to use external encoding information where available if it is
missing. Thus, we check for charset info of Content-Type headers,
and see whether the encoding is supported.

This is just a PHP 7.4+ compatible update of Mike's patch.

Co-authored-by: Michael Wallner mike@php.net

The `encoding` attribute of the XML declaration is optional; it is good
practice to use external encoding information where available if it is
missing.  Thus, we check for `charset` info of `Content-Type` headers,
and see whether the encoding is supported.

This is just a PHP 7.4+ compatible update of Mike's patch.

Co-authored-by: Michael Wallner <mike@php.net>
@cmb69 cmb69 added the Bug label Mar 2, 2021
@cmb69
Copy link
Member Author

cmb69 commented Mar 2, 2021

cc @m6w6

ext/libxml/libxml.c Outdated Show resolved Hide resolved
Of course, a buffer should be an array.
We do not need to cater to escaped backslashes and quotes in
quoted-strings, since no known character encoding contains these.
@cmb69
Copy link
Member Author

cmb69 commented Mar 4, 2021

The AppVeyor fail is unrelated (this is being worked on). I don't understand why the Azure pipeline hasn't been trigger for the latest commit, though.

@nikic nikic closed this Mar 4, 2021
@nikic nikic reopened this Mar 4, 2021
@cmb69
Copy link
Member Author

cmb69 commented Mar 4, 2021

Thanks @nikic! Now all tests passed.

ext/libxml/libxml.c Show resolved Hide resolved
@php-pulls php-pulls closed this in f901bec Mar 8, 2021
@cmb69 cmb69 deleted the cmb/51903 branch March 8, 2021 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants