protected function setSubmittedJson($field)
    {
        $json = $this->getSubmitted($field);

        if (isset($json)) {
            $decoded = json_decode($json, true);
            if (json_last_error() === JSON_ERROR_NONE) {
                $this->setSubmitted($field, $decoded);
            } else {
                $decoded = json_decode(base64_decode($json), true);
                if (json_last_error() !== JSON_ERROR_NONE) {
                    throw new InvalidArgumentException('Failed to decode the submitted JSON string');
                }
                $this->setSubmitted($field, $decoded);
            }
        }
    }
protected function setSubmittedJson($field)
    {
        $json = $this->getSubmitted($field);

        if (isset($json)) {
            $decoded = json_decode($json, true);
            if (json_last_error() === JSON_ERROR_NONE) {
                $this->setSubmitted($field, $decoded);
            } else {
                $decoded = json_decode(base64_decode($json), true);
                if (json_last_error() !== JSON_ERROR_NONE) {
                    throw new InvalidArgumentException('Failed to decode the submitted JSON string');
                }
                $this->setSubmitted($field, $decoded);
            }
        }
    }
protected function setSubmittedJson ( $ field ) { $ json = $ this -> getSubmitted ( $ field ) ; if ( isset ( $ json ) ) { $ decoded = json_decode ( $ json , true ) ; if ( json_last_error ( ) === JSON_ERROR_NONE ) { $ this -> setSubmitted ( $ field , $ decoded ) ; } else { $ decoded = json_decode ( base64_decode ( $ json ) , true ) ; if ( json_last_error ( ) !== JSON_ERROR_NONE ) { throw new InvalidArgumentException ( 'Failed to decode the submitted JSON string' ) ; } $ this -> setSubmitted ( $ field , $ decoded ) ; } } }
Convert a submitted JSON string into an array or FALSE on error
@param string $field
Convert a submitted JSON string into an array or FALSE on error