Jump to content



Latest News: (loading..)

- - - - -

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

general.php

  • Please log in to reply
5 replies to this topic

#1   DriWashSolutions

DriWashSolutions
  • Members
  • 216 posts
  • Real Name:John Skurka
  • Location:Ithaca, NY

Posted 12 July 2012 - 01:14 PM

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?

Edited by DriWashSolutions, 12 July 2012 - 01:19 PM.

John Skurka

#2   DriWashSolutions

DriWashSolutions
  • Members
  • 216 posts
  • Real Name:John Skurka
  • Location:Ithaca, NY

Posted 30 July 2012 - 10:07 PM

Anything?  I can't be the only one getting this error...
John Skurka

#3   FWR Media

FWR Media
  • Community Sponsor
  • 6,839 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 31 July 2012 - 06:31 AM

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.

#4   DriWashSolutions

DriWashSolutions
  • Members
  • 216 posts
  • Real Name:John Skurka
  • Location:Ithaca, NY

Posted 04 August 2012 - 01:32 AM

View PostFWR Media, on 31 July 2012 - 06:31 AM, said:

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

#5   DriWashSolutions

DriWashSolutions
  • Members
  • 216 posts
  • Real Name:John Skurka
  • Location:Ithaca, NY

Posted 04 August 2012 - 02:05 AM

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.

Edited by DriWashSolutions, 04 August 2012 - 02:06 AM.

John Skurka

#6   FWR Media

FWR Media
  • Community Sponsor
  • 6,839 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 04 August 2012 - 10:13 AM

View PostDriWashSolutions, on 04 August 2012 - 02:05 AM, said:

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.