Post by devplus » Thu Jun 27, 2013 1:06 am

After upgrading from 1.5.4.1 to 1.5.5.1 I am getting the following error:

PHP Warning: htmlspecialchars(): Invalid multibyte sequence in argument in httpdocs/system/library/request.php on line 33

Line 33 of request.php is inside the following function:
public function clean($data) {
if (is_array($data)) {
foreach ($data as $key => $value) {
unset($data[$key]);

$data[$this->clean($key)] = $this->clean($value);
}
} else {
$data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8'); <!-- THIS IS LINE 33 -->
}

return $data;
}

Any idea?

New member

Posts

Joined
Fri May 18, 2012 11:43 pm

Post by DaCrash » Mon Aug 19, 2013 12:38 am

same for me....

in the url there are some encoded symbols like the german ÖÄÜ etc. They are urlencoded to something like %F6 (thats the german "ö".

I think this is causing the error. But I don't know how to solve it...

Image
DG-Webservices- Webdesign und Programmierung aus Friesland


User avatar
New member

Posts

Joined
Mon Feb 22, 2010 8:02 pm
Location - Germany

Post by DaCrash » Mon Aug 19, 2013 3:28 am

I found the reason...

in the former request.php there was the following line:

Code: Select all

$data = htmlspecialchars($data, ENT_COMPAT);
now there is the following:

Code: Select all

$data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8'); 
Thats why non-UTF8 urls can not be parsed anymore. I think it is a bug ...

Image
DG-Webservices- Webdesign und Programmierung aus Friesland


User avatar
New member

Posts

Joined
Mon Feb 22, 2010 8:02 pm
Location - Germany

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by tom327 » Fri Dec 06, 2013 3:18 am

I was getting this error using authroize.net.

Would there be any downside to changing the line back and removing the UTF-8 parameter?

Active Member

Posts

Joined
Thu Feb 16, 2012 7:33 am

Post by tom327 » Sun Dec 29, 2013 1:48 pm

I found two websites that might provide some info, but does not solve problem. They seem to say the problem is with the string being passed as an argument to htmlspecialchars(). In that case, where does that string come from?

http://scito.ch/content/php-multibyte-u ... lem-solved

http://insomanic.me.uk/post/191397106/p ... es-invalid

Active Member

Posts

Joined
Thu Feb 16, 2012 7:33 am

Post by tom327 » Thu Feb 06, 2014 3:31 pm

Has anyone found a solution to this?

or is this a case that this error message is nothing to worry about?

Active Member

Posts

Joined
Thu Feb 16, 2012 7:33 am

Post by butte » Fri Feb 07, 2014 12:37 am

(1) On changing the line back and removing the UTF-8 parameter, probably not but try it both ways.

(2) Try opening the file(s) and resaving as UTF-8 WITHOUT BOM. That has salvaged language packs, it might work with this. The problem arises when an ascii editor saves with a flavor; BOM. Properly pure ascii editors don't do that. If there is a specific setting for saving with carriage returns and linefeeds for Windows or for Linux, be certain not to save the wrong way for files uploaded to the server.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by henkbart » Tue Jun 17, 2014 7:35 pm

Hello,

Google is wonderfull.

Read this

https://www.93i.de/devzone/opencart-htm ... e-sequence

I hope this solves the problem.

Henk

Newbie

Posts

Joined
Sun May 12, 2013 11:35 pm
Who is online

Users browsing this forum: No registered users and 12 guests