Fix unserialize parameters issues in old models
[MAILPOET-3296]
This commit is contained in:
committed by
Veljko V
parent
ec19b565f5
commit
df22724cf7
@ -36,7 +36,7 @@ class CustomField extends Model {
|
|||||||
if (isset($model['params'])) {
|
if (isset($model['params'])) {
|
||||||
$model['params'] = (is_array($this->params))
|
$model['params'] = (is_array($this->params))
|
||||||
? $this->params
|
? $this->params
|
||||||
: unserialize($this->params);
|
: ($this->params !== null ? unserialize($this->params) : false);
|
||||||
}
|
}
|
||||||
return $model;
|
return $model;
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ class DynamicSegmentFilter extends Model {
|
|||||||
public function __get($name) {
|
public function __get($name) {
|
||||||
$name = Helpers::camelCaseToUnderscore($name);
|
$name = Helpers::camelCaseToUnderscore($name);
|
||||||
$value = parent::__get($name);
|
$value = parent::__get($name);
|
||||||
if ($name === 'filter_data' && WPFunctions::get()->isSerialized($value)) {
|
if ($name === 'filter_data' && $value !== null && WPFunctions::get()->isSerialized($value)) {
|
||||||
return unserialize($value);
|
return unserialize($value);
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
|
@ -16,10 +16,16 @@ class Form extends Model {
|
|||||||
public static $_table = MP_FORMS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
|
public static $_table = MP_FORMS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
|
||||||
|
|
||||||
public function getSettings() {
|
public function getSettings() {
|
||||||
|
if (is_array($this->settings) || $this->settings === null) {
|
||||||
|
return $this->settings;
|
||||||
|
}
|
||||||
return WPFunctions::get()->isSerialized($this->settings) ? unserialize($this->settings) : $this->settings;
|
return WPFunctions::get()->isSerialized($this->settings) ? unserialize($this->settings) : $this->settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBody() {
|
public function getBody() {
|
||||||
|
if (is_array($this->body) || $this->body === null) {
|
||||||
|
return $this->body;
|
||||||
|
}
|
||||||
return WPFunctions::get()->isSerialized($this->body) ? unserialize($this->body) : $this->body;
|
return WPFunctions::get()->isSerialized($this->body) ? unserialize($this->body) : $this->body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ class SendingQueue extends Model {
|
|||||||
* Used only for checking processed subscribers in old queues
|
* Used only for checking processed subscribers in old queues
|
||||||
*/
|
*/
|
||||||
private function getSubscribers() {
|
private function getSubscribers() {
|
||||||
if (!is_serialized($this->subscribers)) {
|
if (is_array($this->subscribers) || $this->subscribers === null || !is_serialized($this->subscribers)) {
|
||||||
return $this->subscribers;
|
return $this->subscribers;
|
||||||
}
|
}
|
||||||
$subscribers = unserialize($this->subscribers);
|
$subscribers = unserialize($this->subscribers);
|
||||||
|
Reference in New Issue
Block a user