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

HtmlWriter comments are not html encoded #1038

Closed
dstoever opened this issue Jun 27, 2019 · 2 comments
Closed

HtmlWriter comments are not html encoded #1038

dstoever opened this issue Jun 27, 2019 · 2 comments

Comments

@dstoever
Copy link

This is:

- [* ] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

Characters like < has to changed to < in the cell comments

What is the current behavior?

Characters like < are not html encoded

What are the steps to reproduce?

Save a spreadsheet with characters like < in a cell comment

// add code that show the issue here...

The error is in Html.php line 1662
Now:
$result .= '

' . nl2br($pSheet->getComment($coordinate)->getText()->getPlainText()) . '
';

Should be:
$result .= '

' . nl2br(htmlspecialchars($pSheet->getComment($coordinate)->getText()->getPlainText())) . '
';

Which versions of PhpSpreadsheet and PHP are affected?

1.7.0

@stale
Copy link

stale bot commented Aug 26, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@stale stale bot added the stale label Aug 26, 2019
@stale stale bot closed this as completed Sep 2, 2019
@oleibman
Copy link
Collaborator

oleibman commented Jul 3, 2024

Fixed by PR #3957 in April 2024.

@oleibman oleibman removed the stale label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants