Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Bugfix & compatibility enhancement #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Bugfix & compatibility enhancement #3

wants to merge 2 commits into from

Conversation

billychow
Copy link

  • Fixed compatibility with PHP 5.2 which doesn't support late static binding
  • To force DOMDocument load by UTF-8 (dirty fix)
  • Remove redundant libxml error

Billy.Zhou added 2 commits February 25, 2013 17:09
@chrismcmacken
Copy link
Member

If you can resolve that one comment then I'll test this and pull it in.

@billychow
Copy link
Author

I've tried, but it's not working as we expected.
So I just google it and found a dirty fix to set encoding to utf-8 explicitly.

refer to: http://www.php.net/manual/en/domdocument.loadhtml.php

@chrismcmacken
Copy link
Member

On second thought, we can't hard code this as UTF-8. If there's another encoding in use we don't want to import it as UTF-8. We should find the encoding from the document that we're parsing, if there isn't one it should default to ISO-8859-1 as the HTTP 1.1 spec says that's what the default should be.

It looks like this is going to be a little bit bigger than the simple fix proposed above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants