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 ampersand corrupting document #1501

Closed
wants to merge 2 commits into from

Conversation

silverbackdan
Copy link

@silverbackdan silverbackdan commented Nov 7, 2018

see: #1500

Description

This will replace any ampersand that is not already followed by a semi-colon (making it an HTML character) with &. This is because without converting it, the document cannot be opened.

Fixes #1500

Checklist:

  • I have run composer run-script check --timeout=0 and no errors were reported
  • The new code is covered by unit tests (check build/coverage for coverage report)
  • n/a I have update the documentation to describe the changes

@silverbackdan
Copy link
Author

silverbackdan commented Nov 7, 2018

FYI: PHP 5.3 test fails due to php running out of memory in travis during the composer install command.

@coveralls
Copy link

coveralls commented Nov 7, 2018

Coverage Status

Coverage increased (+0.001%) to 94.839% when pulling 6245a42 on silverbackdan:patch-1 into 1876062 on PHPOffice:develop.

@troosan
Copy link
Contributor

troosan commented Nov 17, 2018

@silverbackdan wouldn't it be better to do this replacement when generating the document instead of when creating the Text element? What will happen when generating not a docx but an rtf document?

@margori
Copy link

margori commented Dec 7, 2018

Patch applied, bug not solved.
Suggest include test.

@troosan
Copy link
Contributor

troosan commented Dec 8, 2018

Actually, this is the intended behaviour (for backward compatibility reasons).
The get the result you want you have to call

Settings::setOutputEscapingEnabled(true);

@troosan troosan closed this Dec 8, 2018
@silverbackdan
Copy link
Author

right ok, thanks for the additional info - I appreciate everyone's time in replying on this chain. Enjoy your week.

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

Successfully merging this pull request may close these issues.

None yet

4 participants