Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

htmlspecialchars() expects parameter 1 to be string, array given


tinkertrain

Recommended Posts

Version:

OsCommerce Online Merchant v2.2 RC2

Issue: htmlspecialchars() expects parameter 1 to be string, array given

 

Description:

While in the admin panel, (in admin/orders.php) orders show as line items fine

although when you click on the edit button, invoice button or packing slip button I receive the following:

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/content/X/X/X/XXXXXXXXXXX/html/store/admin/includes/functions/general.php on line 40

 

general.php line #40:

function tep_parse_input_field_data($data, $parse) {

 

The correct information for the customer, bill to, & ship to etc.. is present below the 'error(s)' as well as their correct order details.

 

This error does not appear anywhere else (that I've seen)in the program.

 

I have read numerous posts regarding 'Warning: htmlspecialchars()' and tried some with no luck.

 

For 2 days now I've tinkered with it off & on and I'm a bit mystified.

 

Anything specific would be greatly appreciated.

 

Kind thanks in advance.

Link to comment
Share on other sites

Version:

OsCommerce Online Merchant v2.2 RC2

Issue: htmlspecialchars() expects parameter 1 to be string, array given

 

Description:

While in the admin panel, (in admin/orders.php) orders show as line items fine

although when you click on the edit button, invoice button or packing slip button I receive the following:

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/content/X/X/X/XXXXXXXXXXX/html/store/admin/includes/functions/general.php on line 40

 

general.php line #40:

function tep_parse_input_field_data($data, $parse) {

 

The correct information for the customer, bill to, & ship to etc.. is present below the 'error(s)' as well as their correct order details.

 

This error does not appear anywhere else (that I've seen)in the program.

 

I have read numerous posts regarding 'Warning: htmlspecialchars()' and tried some with no luck.

 

For 2 days now I've tinkered with it off & on and I'm a bit mystified.

 

Anything specific would be greatly appreciated.

 

Kind thanks in advance.

 

Hi,

I have the same problem but mine is on line 42.

Have no idea how to fix it either.

 

Fiona

Link to comment
Share on other sites

Hi Fiona,

 

I fixed this (at least for me)

 

in: admin/includes/functions/general.php (and our line numbers may be a bit different due to some other modifications I've made)

 

find:

 

38 function tep_output_string($string, $translate = false, $protected = false) {

40 if ($protected == true) {

41 return htmlspecialchars($string);

42 } else {

43 if ($translate == false) {

44 return tep_parse_input_field_data($string, array('"' => '"'));

45 } else {

46 return tep_parse_input_field_data($string, $translate);

47 }

48 }

49 }

 

I changed line 40 to this:

40 if ($protected == false) {

 

Changed the true to false and it cured it.

 

I hope this helps you too.

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
  • 3 weeks later...
  • 1 year later...

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

catalog/admin/includes/functions/general.php

catalog/includes/functions/general.php

He who sits in jelly, has ass in jam.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...