mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
FIX Replace Convert JSON methods with json_* methods, deprecated from SilverStripe 4.4
This commit is contained in:
parent
21d8212807
commit
fc934d93fd
@ -122,7 +122,7 @@ class EditableSpamProtectionField extends EditableFormField
|
||||
*/
|
||||
public function onBeforeWrite()
|
||||
{
|
||||
$fieldMap = Convert::json2array($this->SpamFieldSettings);
|
||||
$fieldMap = json_decode($this->SpamFieldSettings, true);
|
||||
if (empty($fieldMap)) {
|
||||
$fieldMap = array();
|
||||
}
|
||||
@ -132,7 +132,7 @@ class EditableSpamProtectionField extends EditableFormField
|
||||
$fieldMap[substr($key, 8)] = $value;
|
||||
}
|
||||
}
|
||||
$this->setField('SpamFieldSettings', Convert::raw2json($fieldMap));
|
||||
$this->setField('SpamFieldSettings', json_encode($fieldMap));
|
||||
|
||||
return parent::onBeforeWrite();
|
||||
}
|
||||
@ -192,7 +192,7 @@ class EditableSpamProtectionField extends EditableFormField
|
||||
*/
|
||||
public function spamMapValue($mapSetting)
|
||||
{
|
||||
$map = Convert::json2array($this->SpamFieldSettings);
|
||||
$map = json_decode($this->SpamFieldSettings, true);
|
||||
if (empty($map)) {
|
||||
$map = array();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user