Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Warning: trim() expects parameter 1 to be string, array given


DriWashSolutions

Recommended Posts

My host just upgraded to PHP V5.3, and now the checkout_confirmation.php routine gives the following error:

 

Warning: trim() expects parameter 1 to be string, array given in /home/myhome/public_html/catalog/includes/functions/general.php on line 42

 

Line 42 is contains the following:

 
// Parse the data used in the html tags to ensure the tags will not break
 function tep_parse_input_field_data($data, $parse) {
   return strtr(trim($data), $parse);

 

I just checked the same routine for v2.3.1 and the code is the same.

 

Anyone have a fix?

John Skurka

Link to comment
Share on other sites

  • 3 weeks later...

It is not an issue of osCommerce it must be an issue related to modifications made to osCommerce.

 

It doesn't make sense to attempt to insert an array into a single input field. Therefore the function that parses the data to ensure the tags will not break ( tep_parse_input_field_data() ) does not expect an array.

Link to comment
Share on other sites

It is not an issue of osCommerce it must be an issue related to modifications made to osCommerce.

 

If it's not an osCommerce issue, and I'm running v2.2, how is it that the code for version 2.3.1 is exactly the same?

John Skurka

Link to comment
Share on other sites

This is the piece of code that is causing the two lines of errors. This code is located around line 326 in my checkout_confirmation.php:

 if (is_array($payment_modules->modules)){
echo $payment_modules->process_button();
 }

 

If I comment the code out, the errors disappear, but then my CC processing does work.

John Skurka

Link to comment
Share on other sites

This is the piece of code that is causing the two lines of errors. This code is located around line 326 in my checkout_confirmation.php:

 if (is_array($payment_modules->modules)){
echo $payment_modules->process_button();
 }

 

If I comment the code out, the errors disappear, but then my CC processing does work.

 

Well look at [my cc process]::process_button() then.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...