Compile error in add new payment method

  • Posts: 22
  • Thank you received: 0
  • Hikashop Business
2 months 1 week ago #359200

-- url of the page with the problem -- : shop.hansplanje.nl
-- HikaShop version -- : 5.0.3
-- Joomla version -- : 4.4.2
-- PHP version -- : 8.1
-- Browser(s) name and version -- : firefox latest
-- Error-message(debug-mod must be tuned on) -- : Hi, I found an compile error in HikaShop when creating a new payment method.


The error mentions: Compile Error: Array and string offset access syntax with curly braces is no longer supported (in line 17)


public static function getScriptNameFromUrl ( $url )
{
$path = parse_url($url, PHP_URL_PATH);
$len = strlen($path);
if ( $len == 0 || '/' == $path{$len-1} ) {
return "";
}
return basename($path);
}

Hi,

When adding a new payment method I got a http 500 fatal error.

Can you look into this issue?

Kind regards,

Winfried Buijen

Attachments:

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

  • Posts: 81562
  • Thank you received: 13071
  • MODERATOR
2 months 1 week ago #359201

Hi,

This error comes from this code: $path{$len-1}
This is not valid in recent versions of PHP. It should be $path[$len-1] instead.

There was actually this code in the old versions of the Platron plugin which hasn't been included in HikaShop for years and which latest version can be found here:
github.com/HikaShop/hikashoppayment-platron
So either update the plugin or uninstall it if you're not using it and you won't have this error.

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

Time to create page: 0.061 seconds
Powered by Kunena Forum