[Tickets #10935] json_encode(); public, private, protected object properties

bugs at horde.org bugs at horde.org
Fri Jan 20 17:11:17 UTC 2012


BITTE NICHT AUF DIESE NACHRICHT ANTWORTEN. NACHRICHTEN AN DIESE  
E-MAIL-ADRESSE WERDEN NICHT GELESEN.

Ticket-URL: http://bugs.horde.org/ticket/10935
------------------------------------------------------------------------------
  Ticket           | 10935
  Erstellt Von     | roman at stachura.ch
  Zusammenfassung  | json_encode(); public, private, protected object
                   | properties
  Warteschlange    | Horde Framework Packages
  Version          | Git master
  Typ              | Bug
  Status           | Unconfirmed
  Priorität        | 2. Medium
  Milestone        |
  Patch            |
  Zuständige       |
------------------------------------------------------------------------------


roman at stachura.ch (2012-01-20 17:11) hat geschrieben:

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






More information about the bugs mailing list