|
|
| |
1. decode not working |
|
Reply |
|
|
 Mike | 2007-05-07 22:00:51 |
Undefined variable: resultFATAL: FastJSON decode method failure [malicious or incorrect JSON string]
Code :
include_once('lib/FastJSON.php');
$jsonEnc= new FastJSON();
//var_dump($_REQUEST);
//this works
$enVal=$jsonEnc->encode($_REQUEST);
var_dump($enVal);
// this gives error
$deVal=$jsonEnc->decode($enVal,false);
var_dump($deVal); |
| |
2. Re: decode not working |
|
Reply |
|
|
 Igor Frias Vieira | 2008-12-10 19:40:46 - In reply to message 1 from Mike |
Undefined variable: resultFATAL: FastJSON decode method failure [malicious or incorrect JSON string]
same problem...
my json string:
{"titulo" : "sdfsdf", "versao" : "", "materias" : [{"nome" : "Matéria", "perguntas" : [{"nome" : "Pergunta", "comentario" : "", "file_id" : "0_0", "respostas" : [{"nome" : "Resposta", "correta" : "1"}, {"nome" : "Resposta", "correta" : "0"} ]} ]} ]} |
| |
3. Re: decode not working |
|
Reply |
|
|
 Oleg | 2009-02-05 09:42:53 - In reply to message 1 from Mike |
Solution.
Go to
function "__decode" -> operatar "switch" -> "case '{'" -> "while".
In this "while" replace
"$tmp = FastJSON::__decodeString($encode, $pos);"
to
"$tmp = FastJSON::__decode($encode, $pos, $slen, $stdClass);".
P.S.: It helps me, i hope u too :)
|
| |
4. Re: decode not working |
|
Reply |
|
|
 boppy | 2009-10-12 14:09:45 - In reply to message 3 from Oleg |
| oleg, ymmd! ;) |
|