From a2a88c56a4c155d918cede271f00e3e839ce2a49 Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Fri, 15 Nov 2019 11:54:56 -0500 Subject: [PATCH] Return empty array if no values are $_POST'ed to the form Fixes an issue with tests + null values in logs --- plugins/wporg-5ftf/includes/pledge-form.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/wporg-5ftf/includes/pledge-form.php b/plugins/wporg-5ftf/includes/pledge-form.php index 0a21568..4c56b6c 100755 --- a/plugins/wporg-5ftf/includes/pledge-form.php +++ b/plugins/wporg-5ftf/includes/pledge-form.php @@ -354,7 +354,12 @@ function get_form_submission() { ) ); - return filter_input_array( INPUT_POST, $input_filters ); + $result = filter_input_array( INPUT_POST, $input_filters ); + if ( ! $result ) { + return []; + } + + return $result; } /**