File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -284,7 +284,7 @@ public function bulk_toggle_options() {
284284 wp_send_json_error ( __ ( 'Not allowed. ' , 'plausible-analytics ' ), 403 );
285285 }
286286
287- $ options = json_decode ( wp_unslash ( $ post_data ['options ' ] ) , true );
287+ $ options = json_decode ( $ post_data ['options ' ], true );
288288
289289 if ( empty ( $ options ) ) {
290290 wp_send_json_error ( __ ( 'No options found. ' , 'plausible-analytics ' ), 400 );
@@ -295,6 +295,10 @@ public function bulk_toggle_options() {
295295 $ value = sanitize_text_field ( $ option ['value ' ] );
296296 $ status = sanitize_text_field ( $ option ['status ' ] );
297297
298+ if ( ! isset ( $ settings [ $ name ] ) || ! is_array ( $ settings [ $ name ] ) ) {
299+ continue ;
300+ }
301+
298302 if ( $ status === 'on ' ) {
299303 if ( ! in_array ( $ value , $ settings [ $ name ] ) ) {
300304 $ settings [ $ name ][] = $ value ;
You can’t perform that action at this time.
0 commit comments