Skip to content

Commit

Permalink
Merge branch 'asddeviceconstr' into 'master'
Browse files Browse the repository at this point in the history
fix: invoke ASDevice constructor with 4 parameters

See merge request grommunio/grommunio-sync!80
  • Loading branch information
grammmike committed Jun 21, 2024
2 parents c94b80b + 3123ac7 commit eac762a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/core/stateobject.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* SPDX-FileCopyrightText: Copyright 2007-2016 Zarafa Deutschland GmbH
* SPDX-FileCopyrightText: Copyright 2020-2022 grommunio GmbH
* SPDX-FileCopyrightText: Copyright 2020-2024 grommunio GmbH
*
* Simple data object with some PHP magic
*/
Expand Down Expand Up @@ -46,7 +46,7 @@ public function __set($name, $value) {
if (isset($this->data[$lname]) &&
(
(is_scalar($value) && !is_array($value) && $this->data[$lname] === $value) ||
(is_array($value) && is_array($this->data[$lname]) && $this->data[$lname] === $value)
(is_array($value) && is_array($this->data[$lname]) && $this->data[$lname] === $value)
)) {
return false;
}
Expand Down Expand Up @@ -208,7 +208,8 @@ public function jsonDeserialize($stdObj) {
if (is_object($v) && isset($v->gsSyncStateClass)) {
// TODO: case should be removed when removing ASDevice backwards compatibility
if (strcasecmp($v->gsSyncStateClass, "ASDevice") == 0) {
$this->data[$prop][$k] = new ASDevice(Request::GetDeviceID(), Request::GetDeviceType(), Request::GetGETUser(), Request::GetUserAgent());
$this->data[$prop][$k] = new ASDevice();
$this->data[$prop][$k]->Initialize(Request::GetDeviceID(), Request::GetDeviceType(), Request::GetGETUser(), Request::GetUserAgent());
}
else {
$this->data[$prop][$k] = new $v->gsSyncStateClass();
Expand Down

0 comments on commit eac762a

Please sign in to comment.