Hello Community,
I've just noticed that the fallback in XH_decodeJson() behaves as if the $assoc argument is true, but the native json_decode() is called with the default $assoc == false. IOW: XH_decodeJson() is broken.
How shall we fix it? Shall it behave like $assoc == true or $assoc == false? I suggest the latter, because (a) that's the default behavior of json_encode() and (b) if anybody uses XH_decodeJson() at all (it's not used by the core or the standard plugins) than that's most likely the expected behavior (a dev would probably have tested it with json_decode() available rather than without).
Another option would be to add an optional $assoc parameter to XH_decodeJson(), but that seems to be overkill considering that a potential client (e.g. a plugin) could easily require PHP >= 5.2 and use json_decode() directly.
Thoughts?
Christoph
PS: I've put it on the 1.6.5, because it is a bug.
XH_decodeJson() is broken
XH_decodeJson() is broken
Christoph M. Becker – Plugins for CMSimple_XH