Post by ozstar » Thu Jun 10, 2021 2:32 pm

At the Cart finish I see this error. What could cause that please

oz

Code: Select all

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

OK

<b>Unknown</b>: Function mcrypt_create_iv() is deprecated in <b>/home/bettaaut/public_html/system/library/encryption.php</b> on line <b>8</b>{"country_id":"153","name":"New Zealand","iso_code_2":"NZ","iso_code_3":"NZL","address_format":"","postcode_required":"0","zone":[{"zone_id":"2344","country_id":"153","name":"Auckland","code":"AUK","status":"1"},{"zone_id":"2345","country_id":"153","name":"Bay of Plenty","code":"BOP","status":"1"},{"zone_id":"2346","country_id":"153","name":"Canterbury","code":"CAN","status":"1"},{"zone_id":"2347","country_id":"153","name":"Coromandel","code":"COR","status":"1"},{"zone_id":"2349","country_id":"153","name":"Fiordland","code":"FIO","status":"1"},{"zone_id":"2348","country_id":"153","name":"Gisborne","code":"GIS","status":"1"},{"zone_id":"2350","country_id":"153","name":"Hawke's Bay","code":"HKB","status":"1"},{"zone_id":"2352","country_id":"153","name":"Manawatu-Wanganui","code":"MWT","status":"1"},{"zone_id":"2351","country_id":"153","name":"Marlborough","code":"MBH","status":"1"},{"zone_id":"2353","country_id":"153","name":"Mt Cook-Mackenzie","code":"MCM","status":"1"},{"zone_id":"2354","country_id":"153","name":"Nelson","code":"NSN","status":"1"},{"zone_id":"4034","country_id":"153","name":"New Zealand","code":"All of New Zealand","status":"1"},{"zone_id":"2355","country_id":"153","name":"Northland","code":"NTL","status":"1"},{"zone_id":"2356","country_id":"153","name":"Otago","code":"OTA","status":"1"},{"zone_id":"2357","country_id":"153","name":"Southland","code":"STL","status":"1"},{"zone_id":"2358","country_id":"153","name":"Taranaki","code":"TKI","status":"1"},{"zone_id":"2360","country_id":"153","name":"Waikato","code":"WKO","status":"1"},{"zone_id":"2361","country_id":"153","name":"Wairarapa","code":"WAI","status":"1"},{"zone_id":"2359","country_id":"153","name":"Wellington","code":"WGN","status":"1"},{"zone_id":"2362","country_id":"153","name":"West Coast","code":"WTC","status":"1"}],"status":"1"}

Active Member

Posts

Joined
Fri Mar 09, 2012 7:47 am
Location - Sydney OZ

Post by ADD Creative » Thu Jun 10, 2021 4:51 pm

The issue is that display errors in on. You need to ensure that display errors is switch off in three places. Not only can a minor PHP warning cause bigger issues, as you have seen. It is also a security risk.

1. In your PHP settings. This should be off by default, but there are some poor hosts that leave it on. Set display_errors = off in you php.ini, user.ini, htaccess or hosting control panel, depending on how your hosting works. You can check this with phpinfo().

2. In the OpenCart configuration files. Make sure error_display is false in system/config/default.php (for version 2.2.x or higher).

3. In the Error Handling section under the Server tab in you OpenCart settings.


Once you have done that. You need to decide what to do about the deprecated mcrypt. You options are.

1. Leave as is. As log as your display errors is off you will just get the entries in your log file.

2. Use an older PHP version. Best to ensure your host is using version with the security patches back ported.

3. Upgrade the OpenCart encryption class. Search the forums for options. viewtopic.php?f=125&t=204707#p737628

4. See if you payment module can be modified not to use the encryption class. Some use in unnecessarily.
Last edited by ADD Creative on Fri Jun 11, 2021 4:41 pm, edited 1 time in total.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by ozstar » Fri Jun 11, 2021 9:28 am

Many thanks. Will look into it now.

EDIT.
Looks like there is no default,php in system/config/ only an index file.

Will check the rest out.

Opencart is 1.5.6.1.

Active Member

Posts

Joined
Fri Mar 09, 2012 7:47 am
Location - Sydney OZ

Post by ADD Creative » Fri Jun 11, 2021 4:41 pm

Sorry, system/config/default.php will only be there in 2.2.x or higher.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by straightlight » Fri Jun 11, 2021 5:09 pm

See by replacing the system/library/encryption.php from the master branch if that will solve the issue. Disabling the display errors is one thing but make sure your log entries are still working.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Fri Jun 11, 2021 5:59 pm

straightlight wrote:
Fri Jun 11, 2021 5:09 pm
See by replacing the system/library/encryption.php from the master branch if that will solve the issue.
Pointless to try that. The encryption class from the master branch won't work with 1.5.x without modification.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by straightlight » Fri Jun 11, 2021 6:16 pm

Right ... PHP 8 compatibility. Perhaps the maintenance branch could resolve this way more easily at this time.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Fri Jun 11, 2021 7:54 pm

straightlight wrote:
Fri Jun 11, 2021 6:16 pm
Right ... PHP 8 compatibility. Perhaps the maintenance branch could resolve this way more easily at this time.
Nothing to do with PHP 8 compatibility. Version 3.x and greater require the key yo be passed to encrypt and decrypt. Versions 1.5.x and 2.x require the key to be passed to the Constructor.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by straightlight » Fri Jun 11, 2021 8:00 pm

ADD Creative wrote:
Fri Jun 11, 2021 7:54 pm
straightlight wrote:
Fri Jun 11, 2021 6:16 pm
Right ... PHP 8 compatibility. Perhaps the maintenance branch could resolve this way more easily at this time.
Nothing to do with PHP 8 compatibility. Version 3.x and greater require the key yo be passed to encrypt and decrypt. Versions 1.5.x and 2.x require the key to be passed to the Constructor.
I haven't used these two series in a long time; the advantage when staying up-to-date. As for PHP 8, however, if it'd had nothing to do with it, then the ways to load the methods inside those constructors wouldn't have changed overall since recently.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ozstar » Sat Jun 12, 2021 2:05 pm

Thank you guys

Active Member

Posts

Joined
Fri Mar 09, 2012 7:47 am
Location - Sydney OZ
Who is online

Users browsing this forum: No registered users and 67 guests