fixed API data decoding issue

- added missing features from issue #419
- removed isMailPoetPage() as the logic was flawed
This commit is contained in:
Jonathan Labreuille
2016-07-21 15:10:25 +02:00
parent 3cc43aa302
commit 3e746d1545
3 changed files with 39 additions and 42 deletions

View File

@ -56,9 +56,16 @@ class API {
static function decodeRequestData($data) {
$data = base64_decode($data);
return (is_serialized($data)) ?
unserialize($data) :
self::terminateRequest(self::RESPONSE_ERROR, __('Invalid API data format.'));
if(is_serialized($data)) {
$data = unserialize($data);
}
if(!is_array($data)) {
$data = array();
}
return $data;
}
static function encodeRequestData($data) {