Skip to content

Commit

Permalink
Filter only populated form properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Georgi Nikolov committed Dec 13, 2018
1 parent 1491475 commit 940a755
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/widget/WP_Mailjet_Subscribe_Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ private function sendSubscriptionEmail($subscriptionOptionsSettings, $instance)
case "float":
$propertyNameCopy = $propertyName;
$fProperty = (float) $propertyNameCopy;
if(!is_float($fProperty) || $fProperty == 0) {
return $incorectTypeValue;
}
if ($fProperty == 0 && $propertyName !== "0") {
return $incorectTypeValue;
}
Expand Down Expand Up @@ -222,7 +225,7 @@ private function activateConfirmSubscriptionUrl()
$mailjetContactProperties = $this->getMailjetContactProperties();
if (!empty($mailjetContactProperties)) {
foreach ($mailjetContactProperties as $property) {
if (isset($properties[$property['ID']]) && $properties[$property['ID']] == '' ) {
if (isset($properties[$property['ID']]) && $properties[$property['ID']] != '' ) {
$dataType = $property['Datatype'];
switch ($dataType) {
case "datetime":
Expand Down

0 comments on commit 940a755

Please sign in to comment.