klaviyo / magento2-klaviyo

37 stars 51 forks source link

TP157760: Validate the email is not the empty string #237

Closed award28 closed 1 year ago

award28 commented 1 year ago

Description

Makes sure the set $email in $kl_decoded_cookie is not the empty string.

Manual Testing Steps

> $kl_decoded_cookie = ["email" => ""]
= [
    "email" => "",
  ]

> isset($kl_decoded_cookie["email"])
= true

> isset($kl_decoded_cookie["email"]) && !empty($kl_decoded_cookie["email"])
= false

Pre-Submission Checklist:

NOTE: Please use the Changelogger cli tool to manage versioned file upgrades.

klaviyobot commented 1 year ago

https://klaviyo.tpondemand.com/entity/157760

chavesj commented 1 year ago

Looking at https://phppot.com/php/isset-vs-empty-vs-is_null/ it seems that empty will cover the cases of null, undefined, and "" so AFAICT the check for isset is no longer needed

award28 commented 1 year ago

@chavesj Good catch! I'll remove it from the PR before merging.