Skip to content

_encode() for ParseObject #13

Closed
Closed
@aruvalcaba

Description

@aruvalcaba

Hello I think the _encode() for ParseObject is not implemented correctly.

_encode() should not json_encode at all (Like the ParseGeoPoint encode method). If nested arrays are encoded (due to recursion) then encoding the top level array will cause a heap of issues when parsing the final JSON using existing JSON parsers.

The encode should really be a toArray() method, where the result can be passed to a json_encode().

Line 790 and 795 should check if $value and $item are either a instanceof ParseObject or ParseGeoPoint. Since ParseGeoPoint is not being checked, then it will never be encoded.

I have made changes to my application as necessary, but would like to hear discussion. Hope this is clear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions