mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Fix event_message body always empty (#7660)
Message body was not checked. This will update the get and set methods to ensure if the body is present the body can be set and retrieved.
This commit is contained in:
@@ -92,6 +92,10 @@ class event_message implements filterable_payload {
|
|||||||
|
|
||||||
// Use the filter chain to ensure the key is allowed
|
// Use the filter chain to ensure the key is allowed
|
||||||
if ($this->event_filter === null || ($this->event_filter)($name, $value)) {
|
if ($this->event_filter === null || ($this->event_filter)($name, $value)) {
|
||||||
|
if ($name === self::BODY_ARRAY_KEY) {
|
||||||
|
$this->body = $value;
|
||||||
|
return;
|
||||||
|
}
|
||||||
$this->event[$name] = $value;
|
$this->event[$name] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,6 +108,9 @@ class event_message implements filterable_payload {
|
|||||||
public function __get(string $name) {
|
public function __get(string $name) {
|
||||||
self::sanitize_event_key($name);
|
self::sanitize_event_key($name);
|
||||||
if ($name === 'name') $name = 'event_name';
|
if ($name === 'name') $name = 'event_name';
|
||||||
|
if ($name === self::BODY_ARRAY_KEY) {
|
||||||
|
return $this->body;
|
||||||
|
}
|
||||||
return $this->event[$name] ?? '';
|
return $this->event[$name] ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user