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

htmlspecialchars(): charset `0' not supported, assuming utf-8 #1577

Closed
ocyssau opened this issue Jul 9, 2020 · 2 comments
Closed

htmlspecialchars(): charset `0' not supported, assuming utf-8 #1577

ocyssau opened this issue Jul 9, 2020 · 2 comments

Comments

@ocyssau
Copy link

ocyssau commented Jul 9, 2020

This is:

- [x ] 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?

error message :
htmlspecialchars(): charset `0' not supported, assuming utf-8

in file :
..../vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php:90

Trace :
#0 [internal function]: rbinit_exception_error_handler(2, 'htmlspecialchar...', '/usr/share/ranc...', 90, Array)
#1 vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php(89): htmlspecialchars('2009-04-02T16:2...')
#2 vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/DocProps.php(148): PhpOffice\PhpSpreadsheet\Shared\XMLWriter->writeRawData('2009-04-02T16:2...')
#3 vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php(260): PhpOffice\PhpSpreadsheet\Writer\Xlsx\DocProps->writeDocPropsCore(Object(PhpOffice\PhpSpreadsheet\Spreadsheet))

Solution

Can you try to change the line

return $this->writeRaw(htmlspecialchars($text));

to

return $this->writeRaw(htmlspecialchars($text, ENT_QUOTES, 'UTF-8'));

on line 90 of file phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php

Thanks

What are the steps to reproduce?

Only with specials xlsx workbooks

Which versions of PhpSpreadsheet and PHP are affected?

All

@stale
Copy link

stale bot commented Sep 7, 2020

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 Sep 7, 2020
@stale stale bot closed this as completed Sep 20, 2020
@oleibman
Copy link
Collaborator

Probably resolved by Php fix https://bugs.php.net/bug.php?id=71876.

@oleibman oleibman removed the stale label Jul 19, 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