-
☆ A M B ☆
- 24,524 Posts
Hmm. This is a regular MIGx TV, not a MIGXdb TV? If so, those values are stored as a JSON array. It would be very interesting to see what they look like in the database. It is entirely possible that the JSON-processing functions are doing something unexpected in this case. I'm not all that familiar with multi-byte character sets and how they are handled, but I know that some PHP functions don't handle them well under all circumstances. mbstring and other oddities get involved.
What version of PHP are you running?
You probably want to remove that. Too much info there for hackers.
IIRC, I read that later versions of PHP prior to 5.4 will handle multi-byte strings, but their versions of json_encode and json_decode won't. I think there are some workarounds on the web. There is also a workaround in the $modx->fromJSON and $modx->toJSON methods (though I don't know if it works perfectly), so if the MIGx code is calling json_encode and json_decode directly, that could be the problem.
-
☆ A M B ☆
- 24,524 Posts
It does in one function in the main migx.class.php file. Which is probably the problem.
function recursive_decode($array) {
foreach ($array as $key => $value) {
if (is_string($value) && $decoded = json_decode($value, true)) {
$array[$key] = $this->recursive_decode($decoded);
} else {
$array[$key] = $this->recursive_decode($value);
}
}
return $array;
}
-
☆ A M B ☆
- 24,524 Posts
Or whoever might be able to suggest a better way to handle that recursive function. That was the only call to json_decode in the MIGx files. Otherwise, there are a lot of files with the MODX API functions. Whether or not they would have problems I don't know.