diff --git a/includes/Admin/Admin.php b/includes/Admin/Admin.php index 1146cad..d05c303 100644 --- a/includes/Admin/Admin.php +++ b/includes/Admin/Admin.php @@ -1377,6 +1377,7 @@ class Admin { diff --git a/includes/Validator.php b/includes/Validator.php index f0c1d02..049ed80 100644 --- a/includes/Validator.php +++ b/includes/Validator.php @@ -259,7 +259,7 @@ class Validator { $unit_amount = isset( $data['unit_amount'] ) ? str_replace( ',', '.', wp_unslash( $data['unit_amount'] ) ) : ''; $entry_year = $this->sanitize_cost_year( $data ); $distribution_type = sanitize_key( wp_unslash( isset( $data['distribution_type'] ) ? $data['distribution_type'] : 'parcel' ) ); - $is_mandatory = isset( $data['is_mandatory'] ) ? (bool) $data['is_mandatory'] : true; + $is_mandatory = isset( $data['is_mandatory'] ) && '1' === (string) wp_unslash( $data['is_mandatory'] ); return array( 'entry_year' => $entry_year,