From 650afc500a770212469ed8c38e96d778eb30c56c Mon Sep 17 00:00:00 2001 From: kremsy Date: Sun, 7 Jun 2020 16:17:20 +0200 Subject: [PATCH] added error messages on invalid incoming communication messages --- core/Communication/CommunicationManager.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/Communication/CommunicationManager.php b/core/Communication/CommunicationManager.php index 2362d740..2a094bbb 100644 --- a/core/Communication/CommunicationManager.php +++ b/core/Communication/CommunicationManager.php @@ -266,8 +266,10 @@ class CommunicationManager implements CallbackListener, UsageInformationAble { $data = json_decode($data); if ($data == null) { - $data = array("error" => true, "data" => "Data is not provided as an valid AES-196-encrypted encrypted JSON"); + Logger::log("[CommunicationManager] Error: Data is not provided as an valid AES-196 encrypted JSON"); + $data = array("error" => true, "data" => "Data is not provided as an valid AES-196 encrypted JSON"); } else if (!property_exists($data, "method") || !property_exists($data, "data")) { + Logger::log("[CommunicationManager] Invalid Communication Message Received"); $data = array("error" => true, "data" => "Invalid Message"); } else { $answer = $this->triggerCommuncationCallback($data->method, $data->data);