facebook / facebook-ruby-business-sdk

Ruby SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
204 stars 161 forks source link

no implicit conversion of Array into String #121

Closed fxn closed 2 years ago

fxn commented 3 years ago

When an invalid email is set, normalization raises a TypeError:

no implicit conversion of Array into String

Reason is email validation is implemented this way (mod whitespace):

def self.normalize_email(email)
  if EMAIL_REGEX.match(email) == nil
    return ArgumentError, "Invalid email format for the passed email:' + email + '.Please check the passed email format."
  end
  return email
end

and the first return should be a raise.

That incorrect return value for invalid emails ends up being passed to the hashing function, which is the one raising TypeError.

stale[bot] commented 2 years ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

fxn commented 2 years ago

I have not personally tested it, but by reading https://github.com/facebook/facebook-ruby-business-sdk/commit/960193fd892c529c1085371e9958127f954a832e, this issue seems to be fixed. Thanks!