Error by buing products.

  • Posts: 9
  • Thank you received: 2
  • Hikashop Essential
4 hours 29 minutes ago #372561

-- HikaShop version -- : 6.5.0
-- Joomla version -- : 6.1.2
-- PHP version -- : 8.3.29
-- Browser(s) name and version -- : all brawsers
-- Error-message(debug-mod must be tuned on) -- : 0
stripslashes(): Argument #1 ($string) must be of type string, array given
Call Stack
# Function Location
1 () JROOT/plugins/system/securitycheck/src/Extension/Securitycheck.php:1073
2 stripslashes() JROOT/plugins/system/securitycheck/src/Extension/Securitycheck.php:1073
3 Joomla\Plugin\System\Securitycheck\Extension\Securitycheck->second_level() JROOT/plugins/system/securitycheck/src/Extension/Securitycheck.php:1249
4 Joomla\Plugin\System\Securitycheck\Extension\Securitycheck->acciones_no_listas() JROOT/plugins/system/securitycheck/src/Extension/Securitycheck.php:1720
5 Joomla\Plugin\System\Securitycheck\Extension\Securitycheck->onAfterRoute() JROOT/libraries/src/Plugin/CMSPlugin.php:386
6 Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}() JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:454
7 Joomla\Event\Dispatcher->dispatch() JROOT/libraries/vendor/joomla/application/src/AbstractApplication.php:99
8 Joomla\Application\AbstractApplication->dispatchEvent() JROOT/libraries/src/Application/SiteApplication.php:651
9 Joomla\CMS\Application\SiteApplication->route() JROOT/libraries/src/Application/SiteApplication.php:244
10 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:320
11 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:58
12 require_once() JROOT/index.php:51

I’m experiencing an error when trying to purchase products using PayPal.

This issue started after updating to the latest version. It did not occur in previous versions, so it appears to be a regression.

Last edit: 4 hours 28 minutes ago by Bone.

Please Log in or Create an account to join the conversation.

  • Posts: 85860
  • Thank you received: 14101
  • MODERATOR
3 hours 57 minutes ago #372562

Hi,

The error doesn't come from HikaShop. Based on the call stack, it comes from the "second level" protection of the Securitycheck Pro system plugin.

That plugin loops on all the parameters sent in the POST request and runs the PHP function stripslashes on each of them, assuming they are all texts. However, when adding a product to the cart, HikaShop sends some parameters as arrays of values, which is perfectly valid. And on recent versions of PHP, calling stripslashes on an array triggers the fatal error you got, while older versions of PHP only emitted a warning.

So I would recommend to:
- add com_hikashop to the "Second Level exceptions" setting of the Securitycheck Pro plugin, which will avoid the error.
- report the issue to the Securitycheck developers so that they can add the handling of array parameters to their second_level function (their cleanQuery function already handles arrays, so it should be easy for them to fix).

Please Log in or Create an account to join the conversation.

Time to create page: 0.051 seconds
Powered by Kunena Forum