diff --git a/exchange/shoutbox_add.php b/exchange/shoutbox_add.php index 666c179..92640f2 100644 --- a/exchange/shoutbox_add.php +++ b/exchange/shoutbox_add.php @@ -41,17 +41,16 @@ class exchange_shoutbox_add extends gen_class{ * POST Request to add shoutbox entry * * @param array $params Parameters array - * @param string $body XML body of request + * @param string $body body-array of request * * @returns array */ - function post_shoutbox_add($params, $body){ + function post_shoutbox_add($params, $arrBody){ // be sure user is logged in if ($this->user->is_signedin()){ - // parse xml request - $xml = simplexml_load_string($body); - $member_id = ($xml && $xml->charid) ? intval($xml->charid) : intval($this->pdh->get('user', 'mainchar', array($this->user->data['user_id']))); - $text = ($xml && $xml->text) ? trim($xml->text) : ''; + // parse request + $member_id = (isset($arrBody['charid'])) ? intval($arrBody['charid']) : intval($this->pdh->get('user', 'mainchar', array($this->user->data['user_id']))); + $text = (isset($arrBody['text'])) ? trim($arrBody['text']) : ''; // check if member id is valid for this user $valid_members = $this->pdh->get('member', 'connection_id', array($this->user->data['user_id'])); diff --git a/exchange/shoutbox_list.php b/exchange/shoutbox_list.php index 1919794..9b6f12a 100644 --- a/exchange/shoutbox_list.php +++ b/exchange/shoutbox_list.php @@ -42,11 +42,11 @@ class exchange_shoutbox_list extends gen_class{ * GET Request for shoutbox entries * * @param array $params Parameters array - * @param string $body XML body of request + * @param string $body body-array of request * * @returns array */ - public function get_shoutbox_list($params, $body){ + public function get_shoutbox_list($params, $arrBody){ // set response $response = array('entries' => array());