Fix unserialize parameters issues in old models

[MAILPOET-3296]
This commit is contained in:
Rostislav Wolny
2020-11-30 16:35:45 +01:00
committed by Veljko V
parent ec19b565f5
commit df22724cf7
4 changed files with 9 additions and 3 deletions

View File

@@ -16,10 +16,16 @@ class Form extends Model {
public static $_table = MP_FORMS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
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;
}
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;
}