×
Kunena 5.1 Released (13 May 2018)

The Kunena team is pleased to announce Kunena 5.1.0 [K 5.1.0].
Please read the blog post for information: www.kunena.org/blog/192-kunena-5-1-released

× Topics that are moved into this category are generally considered to be closed. Users may want to add additional information but these topics should not be resurrected in order to discuss new problems or unrelated matters.

Question PHP Warning: htmlspecialchars()

More
6 years 8 months ago - 6 years 8 months ago #1 by detlef
Someone knows a solution ? My error_log_php iss full of messages like this

PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 84

Line 84 is
function escape($string) {
return htmlspecialchars($string, ENT_COMPAT, 'UTF-8');

Offerte di lavoro per Operatore Socio Sanitario OSS su Lavoro oss
Last edit: 6 years 8 months ago by detlef.

Please Log in or Create an account to join the conversation.

More
6 years 8 months ago #2 by Matias
Can you find out which messages cause these warnings? It looks that you have some messages which aren't encoded in UTF-8 (are you using russian, greek or other letters?). Maybe some users are using very old browsers which do not support UTF-8?

Please Log in or Create an account to join the conversation.

More
6 years 8 months ago #3 by detlef
I use italian (99%) and english languages in my forum but now I'm finding some spam message in russian or cirillic... Some years ago we had spammers on forum

Offerte di lavoro per Operatore Socio Sanitario OSS su Lavoro oss

Please Log in or Create an account to join the conversation.

More
6 years 8 months ago #4 by Matias
So which messages cause these warnings? Log always stores the page where the error was seen.

Please Log in or Create an account to join the conversation.

More
6 years 8 months ago #5 by detlef
Today I have updated to k1.7 and this is new error log
I cannot see the page that produce it

[30-Aug-2011 10:51:45] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:51:45] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:51:45] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:51:45] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:51:45] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:51:45] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:51:45] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:51:45] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:51:45] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:57:08] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:57:08] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:57:08] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:57:08] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:57:08] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:57:08] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:57:08] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:57:08] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 10:57:08] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 11:44:56] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 11:44:56] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 11:44:56] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 11:44:56] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 11:44:56] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 11:44:56] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 11:44:56] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 11:44:56] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 11:44:56] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 12:08:52] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 12:08:52] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 12:08:52] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 12:08:52] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 12:08:52] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 12:08:52] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 12:08:52] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 12:08:52] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 12:08:52] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 13:52:18] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 13:52:18] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 13:52:18] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 13:52:18] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 13:52:18] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 13:52:18] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 13:52:18] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 13:52:18] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 13:52:18] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 14:20:55] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 14:20:55] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 14:20:55] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 14:20:55] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 14:20:55] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 14:20:55] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 14:20:55] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 14:20:55] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148
[30-Aug-2011 14:20:55] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /home/qoperatn/public_html/administrator/components/com_kunena/libraries/html/parser.php on line 148

Offerte di lavoro per Operatore Socio Sanitario OSS su Lavoro oss

Please Log in or Create an account to join the conversation.

More
6 years 8 months ago #6 by Matias
Damn, it would be nice to know what kind of message causes this, as I've not been able to reproduce it locally, which means that I have no idea what to fix. Every ~1½ hours someone hits a message which has this issue.

Please Log in or Create an account to join the conversation.

More
6 years 8 months ago #7 by detlef
What you think about this solution ?
www.boonex.com/forums/topic/htmlspecialc...rameter-1-ERROR-.htm

Our lines

function escape($string) {
return htmlspecialchars($string, ENT_COMPAT, 'UTF-8');

to

function escape($string) {
return htmlspecialchars((string)$string, ENT_COMPAT, 'UTF-8');

Offerte di lavoro per Operatore Socio Sanitario OSS su Lavoro oss

Please Log in or Create an account to join the conversation.

More
6 years 8 months ago #8 by Matias
Does it work? Because I thought that in this case the input is a string..

Another way is just to suspend the error with @htmlspecialchars(...), but that's not optimal either.

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to add attachements.
  • Not Allowed: to edit your message.
Time to create page: 0.103 seconds