Jump to content

gateway error


robertbell

Recommended Posts

I'm using credit card capture (I know) and after upgrading to CubeCart 6.5.1 (from 6.4.10) and PHP 8.1 I get the following error when placing a test order:

[<strong>Exception</strong>] /home/sojourn1/public_html/modules/gateway/Card_Capture/gateway.class.php:138 - implode(): Argument #2 ($array) must be of type ?array, bool given
https://www.sojourner.biz/index.php?_a=gateway

Am I missing a PHP extension?

Link to comment
Share on other sites

Please try this:

In the Card_Capture module, gateway.class.php, at line 138, find THIS PART:

= implode(' ',unserialize($item['product_options']));

Change THIS PART to:

= implode(' ',unserialize($item['product_options']) ?: array());

PHP 8.1 is much more picky about what is required vs. what is given. If $item['product_options'] cannot be unserialized, a false is returned, which cannot be used with implode(). The added code will determine if unserialize() returns false, and if so, will give an empty array to implode().

I have not tested this.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...