mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
Merge pull request #68 from creative-commoners/pulls/3.0/remove-json-methods
FIX Replace Convert JSON methods with json_* methods, deprecated from SilverStripe 4.4
This commit is contained in:
commit
6d39bc23ec
@ -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