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

addHTML fixes for PHP 5.3 #270

Merged
merged 1 commit into from
Jun 10, 2014
Merged

addHTML fixes for PHP 5.3 #270

merged 1 commit into from
Jun 10, 2014

Conversation

hskrtich
Copy link
Contributor

@hskrtich hskrtich commented Jun 9, 2014

I found 2 bugs with the addHTML function. One when running under PHP 5.3 the default character encoding is ISO-8859-1 (This was changed to UTF-8 in PHP 5.4) which causes loadXML to hork because of it converts things like & nbsp ; to non-valid UTF-8 characters. The second is when you try to use an ampersand in the html you are trying to convert to docx.

@hskrtich
Copy link
Contributor Author

hskrtich commented Jun 9, 2014

I updated the test for addHTML to include some common html entities, quoted text and ampersand.

Adding some HTML Entities to the test for addHTML
@Progi1984 Progi1984 added this to the 0.12.0 milestone Jun 10, 2014
@ivanlanin
Copy link
Contributor

Thanks @bskrtich. I'll merge this ASAP.

@ivanlanin ivanlanin merged commit d17a806 into PHPOffice:develop Jun 10, 2014
ivanlanin added a commit that referenced this pull request Jun 10, 2014
@ghost ghost mentioned this pull request Nov 7, 2014
@AITG
Copy link

AITG commented Mar 24, 2015

Is this issue of embedded & definitely fixed as we're having issues with it, I've had to convert them to ' and ' in order to get the doc generated?

We're Using 0.12.0 of phpword and PHP 5.3.10.

It doesn't matter if we use htmlspecialchars or not, we pass it in correctly as '&amp ;' (without the space) and what gets outputted to the file is '&'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants