From 811fabca5eb4910cb4e24288701e4e0711af6235 Mon Sep 17 00:00:00 2001 From: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com> Date: Tue, 5 Mar 2024 15:44:39 +1100 Subject: [PATCH] Validate third field is set. --- inc/save.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/save.php b/inc/save.php index ed60d2e..5c26eda 100644 --- a/inc/save.php +++ b/inc/save.php @@ -183,7 +183,8 @@ function validate_line( $line, $line_number, $has_only_placeholder_records = nul $exchange = trim( $fields[0] ); $pub_id = trim( $fields[1] ); $account_type = trim( $fields[2] ); - $is_placeholder_record = is_placeholder_record( $exchange, $pub_id, $account_type, $fields[3] ? trim( $fields[3] ) : null ); + $tag_id = ! empty( $fields[3] ) ? trim( $fields[3] ) : null; + $is_placeholder_record = is_placeholder_record( $exchange, $pub_id, $account_type, $tag_id ); // If the file contains placeholder record and no placeholder was already present, set variable. if ( $is_placeholder_record && is_null( $has_only_placeholder_records ) ) {