6.0.0-beta1
7/19/25

[#10935] json_encode(); public, private, protected object properties
Summary json_encode(); public, private, protected object properties
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Not A Bug
Priority 2. Medium
Owners
Requester roman (at) stachura (dot) ch
Created 01/20/2012 (4929 days ago)
Due
Updated 11/21/2013 (4258 days ago)
Assigned
Resolved 11/21/2013 (4258 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
11/21/2013 09:37:36 PM Michael Rubinsky Comment #2
State ⇒ Not A Bug
Reply to this comment
Not really a bug. Our RPC interface was not designed to transport full 
application objects like this.  All data to be accessible over the API 
should be public. Furthermore, for Horde 6 we need to either always 
return hashes from the API, add another RPC-safe API, or otherwise 
mark API methods as RPC-safe.
01/20/2012 05:11:16 PM roman (at) stachura (dot) ch Comment #1
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ json_encode(); public, private, protected object properties
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
Reply to this comment
External api calls like:

Horde_RPC::request(
         'jsonrpc',
         $rpc_endpoint,
        'calendar.listEvents',
        $rpc_parameters,
        $rpc_options
);

call on the server side the php function json_encode($data);[1]

In the file libs/Horde/Serialize.php on  Line 242

The json_encode(); can not serialize protected properties.
Therefore a lot of data get lost.


Either we fix that on the base class level as mentioned here [2]
or we do some fancy regex on the data string [3], before we convert to json.

What do you think of this?

Regards roman

[1] http://php.net/manual/en/function.json-encode.php
[2] http://www.php.net/manual/en/function.json-encode.php#98718
[3] http://www.php.net/manual/en/function.json-encode.php#76215

Saved Queries