0

I'm having an issue with this piece of code

unserialize($this->getConfigData('multi_payment_options'));

This line

$this->getConfigData('multi_payment_options')

returns this string from the database field that contains

{'_1615302093561_561':{'label':'Nul','minimum':'','maximum':'','contract':'',
'count':'1','period':'1','first':''}}

but doing this I'm getting the following error :

unserialize(): Error at offset 0 of 114 bytes

So doing some digging I understand there is an encodage issue with that string, but I don't know what it is not how to fix it. The field is supposed to store an array

Any ideas ?

Claims
  • 245
  • 2
  • 15
  • 1
    That is JSON - serialized data is more like `a:3:{i:1;s:6:"elem 1";i:2...` – Nigel Ren Mar 09 '21 at 15:56
  • It's funny when you know it's a core functionnality, so basicaly that means they are using unserialize instead of json_decode there. It's from the Lyranetwork Payzen core. – Claims Mar 09 '21 at 16:00
  • It's not JSON either. JSON uses double quotes. – Evert Mar 09 '21 at 18:13

0 Answers0