Solved: htmlspecialchars() expects parameter 1

10 years 5 months ago #411 by Sandra
After updating my php to 5.2.17. I got the following error.

Warning: htmlspecialchars() expects parameter 1 to be string, array given in administrator/components/com_oscommerce/includes/functions/general.php on line 266

to solve this problem change:

 function tep_output_string($string, $translate = false, $protected = false) {
 if ($protected == true) {
 return htmlspecialchars($string);
 } else {
 if ($translate == false) {
 return tep_parse_input_field_data($string, array('"' => '"'));
 } else {
 return tep_parse_input_field_data($string, $translate);

I changed line 40 to this:
if ($protected == false) {

Changed the true to false and it solve the problem.

I had to do the edit in 2 spots...but that error is gone now.

Please Log in to join the conversation.

Time to create page: 0.174 seconds
Events Joomla
Finnaly it's here:
No bridges, no look a likes!
This is the ultimate integration
between Oscommerce and Joomla!
Site Showcase
Follow us