| @@ -145,9 +145,19 @@ | ||
| 145 | 145 | $this->value = $this->get_response(); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | public function parse_value( $value ) { |
| 149 | + if ( is_array( $value ) && ! $this->allows_array_value() ) { | |
| 150 | + $this->collect_error( 'invalid_value' ); | |
| 151 | + | |
| 152 | + return ''; | |
| 153 | + } | |
| 154 | + | |
| 149 | 155 | return $value; |
| 156 | + } | |
| 157 | + | |
| 158 | + protected function allows_array_value(): bool { | |
| 159 | + return false; | |
| 150 | 160 | } |
| 151 | 161 | |
| 152 | 162 | public function check_response() { |
| 153 | 163 | if ( |