Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Warning | htmlspecialchars(): Invalid multibyte sequence in argument
Avatar
Snabel
Member
Free Members
sp_UserOfflineSmall Offline
Apr 6, 2013 - 10:50 am

Hi
I have a strange problem. My error log is filled up since yesterday by a lot of the following messages.

file: /simple-press/sp-api/sp-api-filters.php
line: 1704
function: htmlspecialchars
Warning | htmlspecialchars(): Invalid multibyte sequence in argument

The strange thing is that I cloned the entire site with Duplicator and test it in Localhost but everything looks good, no error code in the log.
I have the latest version of sp and all plugins, the only configuration that has changed is that I activated the polls that works well.

What can cause these error codes on my live site but does not show anything in the log on the cloned site in Localhost?
The error codes are generated only on live site, what can it be?

Does anyone recognize the error code?

Regards
Snabel

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 6, 2013 - 12:52 pm

That would suggest a CHARSET problem.That routine uses the charset that is set by your wp-config.php so maybe there is something in a forum post (and it WILL: be in a post) that breaks the charset in some way... perhaps some unexpected characters in a post or something...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 6, 2013 - 12:57 pm

no, have not seen this before... but might be able to offer a suggestion... but some questions first...

on the two sites (live and local) what is the char set in use for the db?  and any chance you are using php 5.4? 

Are all your posts displaying properly? can you 'make' it happen on specific post content?

the 5.4 version of php has made a change to the way htmlspecialchars() works or at least potentially.. and for 'nonstandard' charsets this can cause it to behave differently.  In our next version we (and WP in 3.6) have changed the way we use that function to try to handle this...

so perhaps you could change that line 1704 to:

        $content = htmlspecialchars($content, ENT_QUOTES, SFCHARSET);

assuming that is the same line (we added the SFCHARSET part)...  and see if that helps...

Avatar
Snabel
Member
Free Members
sp_UserOfflineSmall Offline
Apr 7, 2013 - 12:50 am

Everything works in general as it should.
I tried changing the line in 1704 but there was no difference.

Live site has PHP Version: 3.5.10-1ubuntu3.6 and MySql Version: 5.5.29  Server: Version: Apache/2.2.22
Localhost, PHP Version: 5.4.7 and MySql Version: 5.5.27  Server: Apache/2.4.3
Both sites run UTF8 as they should

Since only one of the sites affected by error codes and sites in general are identical while the server environment to my knowledge has not changed it should reasonably happened something with my host.
I wait a day and keep track of the log before contacting them.

I thank you for the answers so far and will return when there is more to tell.
/Snabel

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 7, 2013 - 1:13 am

okay thanks for the update...

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 7, 2013 - 3:22 am

I don't follow the php version on your live site? Is that seriously V3 of php? WordPress needs version 5.2.4 of php as minimum - as does SP. So I assume I am missing something here?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Snabel
Member
Free Members
sp_UserOfflineSmall Offline
Apr 7, 2013 - 7:25 am

Yellow Swordfish said
I don't follow the php version on your live site? Is that seriously V3 of php? WordPress needs version 5.2.4 of php as minimum - as does SP. So I assume I am missing something here?

Sorry:

PHP Version: 5.3.10-1ubuntu3.6

 

Avatar
Kenn
Somerset, UK
Member
Free Members
sp_UserOfflineSmall Offline
Apr 15, 2013 - 7:24 pm

Snabel:

Did you ever work out what it was? Our error log is full of the same notice.

 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 15, 2013 - 7:29 pm

did you try the fix in post 3?  what is the charset/coallation on your db?

Avatar
Kenn
Somerset, UK
Member
Free Members
sp_UserOfflineSmall Offline
Apr 15, 2013 - 7:51 pm

Thanks for the quick reply, appologies I had overlooked the fix in post 3, have changed now and will wait to see if it stops the error it appears every 15-20mins so should be able to notice quite quickly.

UTF-8 Charset

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625