Splendid
Splendid

Reputation: 1357

Whats wrong with this serialized string

So I went trough all serialization related questions, and I pattched some other strings but I am not able to figur out how to deserialize this on in php

a:26:{i:0;a:2:{s:4:"name";s:0:"";s:5:"value";N;}i:1;a:2:{s:4:"name";s:7:"account";s:5:"value";s:3:"771";}i:2;a:2:{s:4:"name";s:10:"passengers";s:5:"value";s:1:"1";}i:3;a:2:{s:4:"name";s:8:"triptype";s:5:"value";s:7:"One Way";}i:4;a:2:{s:4:"name";s:10:"cabinclass";s:5:"value";s:7:"Economy";}i:5;a:2:{s:4:"name";s:2:"id";s:5:"value";s:1:"4";}i:6;a:2:{s:4:"name";s:5:"empty";s:5:"value";s:5:"false";}i:7;a:2:{s:4:"name";s:12:"accountvalue";s:5:"value";s:18:"Pantanal / Cerrado";}i:8;a:2:{s:4:"name";s:6:"tagsid";s:5:"value";s:0:"";}i:9;a:2:{s:4:"name";s:11:"tagsidvalue";s:5:"value";s:0:"";}i:10;a:2:{s:4:"name";s:8:"location";s:5:"value";s:2:"30";}i:11;a:2:{s:4:"name";s:13:"locationvalue";s:5:"value";s:6:"Brazil";}i:12;a:2:{s:4:"name";s:9:"startdate";s:5:"value";s:10:"2018-07-05";}i:13;a:2:{s:4:"name";s:11:"departvalue";s:5:"value";s:96:"CNF - Tancredo Neves International (Confins International), Belo Horizonte, Minas Gerais, Brazil";}i:14;a:2:{s:4:"name";s:6:"depart";s:5:"value";s:3:"475";}i:15;a:2:{s:4:"name";s:11:"arrivevalue";s:5:"value";s:69:"CGH - Congonhas International Airport, São Paulo, São Paulo, Brazil";}i:16;a:2:{s:4:"name";s:6:"arrive";s:5:"value";s:3:"351";}i:17;a:2:{s:4:"name";s:13:"travellername";s:5:"value";s:14:"Rezende/Rosana";}i:18;a:2:{s:4:"name";s:8:"totalco2";s:5:"value";s:4:"0.09";}i:19;a:2:{s:4:"name";s:3:"ref";s:5:"value";s:10:"1423093921";}i:20;a:2:{s:4:"name";s:9:"admincode";s:5:"value";s:8:"19070223";}i:21;a:2:{s:4:"name";s:14:"departmentcode";s:5:"value";s:13:"'0939.9070.01";}i:22;a:2:{s:4:"name";s:8:"costcode";s:5:"value";s:9:"1423.1.00";}i:23;a:2:{s:4:"name";s:11:"projectcode";s:5:"value";s:17:"Cerrado Pantanal ";}i:24;a:2:{s:4:"name";s:13:"purchaseorder";s:5:"value";s:9:"R$ 395,36";}i:25;a:2:{s:4:"name";s:5:"notes";s:5:"value";s:134:"Reunião do Subcomitê da Bacia do Jequitibá em Prudente de MoraeS Reuniões empresas pelo Selo Social. em Sete Lagoas de 24 a 05/07 ";}}

I believe that string above is built with serialize($string) function in PHP in some of the legacy versions, and now with unserialize function in 7.2 this is not doable.

Any suggestions ?

Upvotes: 0

Views: 52

Answers (1)

Nigel Ren
Nigel Ren

Reputation: 57131

I think the problem is where the various non standard characters are causing problems with the string length indicators. If you utf8_decode() it first it should work...

unserialize(utf8_decode($input))

Upvotes: 1

Related Questions