Modified: trunk/Sungrazr/Server/Adapter/JsonRpc.php (113 => 114)
--- trunk/Sungrazr/Server/Adapter/JsonRpc.php 2008-02-10 19:55:19 UTC (rev 113)
+++ trunk/Sungrazr/Server/Adapter/JsonRpc.php 2008-02-25 21:34:42 UTC (rev 114)
@@ -31,7 +31,7 @@
* @var array
*
*/
- protected $_Sungrazr_Server_Adapter = array(
+ protected $_Sungrazr_Server_Adapter_JsonRpc = array(
'return' => false,
'headers' => array(),
'content_types' => array(
@@ -306,6 +306,13 @@
$properties = array('method', 'params', 'id');
$obj = json_decode($serialized);
+ if (! is_object($obj)) {
+ return $this->fault(
+ 'The request was not a valid JSON object; It could not be parsed.',
+ -1
+ );
+ }
+
foreach ($properties as $p) {
if (! empty($obj->{$p})) {
$this->{$p} = $obj->{$p};