Skip to main content

Compile error in add new payment method

More
2 years 7 months ago #359200 by W13ear
-- 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

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

More
2 years 7 months ago #359201 by nicolas
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.134 seconds
Powered by Kunena Forum