Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Length problems with ip_registration_newsletter #1056

Closed
eschiendorfer opened this issue Sep 15, 2019 · 5 comments
Closed

Length problems with ip_registration_newsletter #1056

eschiendorfer opened this issue Sep 15, 2019 · 5 comments
Labels

Comments

@eschiendorfer
Copy link
Contributor

Since using 1.1.0 I have had two complaints, that customers can not add orders to my shop. As you know: customers can never be precise about their report. It's just like: "I didn't work.".

I couldn't reproduce it myself, but I am quite sure, that it's about ip_registration_newsletter value, which is fixed to the size of 15: https://github.com/thirtybees/thirtybees/blob/1.1.x/classes/Customer.php#L63

If sombody has a longer IP address (maybe IPv6), it fails: Property Customer->ip_registration_newsletter length (39) must be between 0 and 15

@getdatakick
Copy link
Contributor

This problem is not in 1.1.0 but in 1.1.x.

In 1.1.0 the ipv6 address is silently truncated during save. In 1.1.x error is displayed instead of truncating value.

The fix is to simply change definition to 'size'=>39

@eschiendorfer
Copy link
Contributor Author

Ok thanks a lot. You are right about 1.1.x Is it save to just make 39 or can there appear even bigger lengths?

@getdatakick
Copy link
Contributor

An IPv6 address, at its longest, would be 8 sets of 4 characters (32 total), each set separated by a colon. That makes 39 characters.

eschiendorfer added a commit to eschiendorfer/thirtybees that referenced this issue Sep 16, 2019
eschiendorfer added a commit to eschiendorfer/thirtybees that referenced this issue Sep 16, 2019
@eschiendorfer
Copy link
Contributor Author

Thanks for explanation. I have now created a new branch and a PR :)

@Traumflug Traumflug added the Bug label Sep 17, 2019
Traumflug pushed a commit that referenced this issue Sep 26, 2019
Traumflug's review edits:

 - Meaningful commit message.

 - Maximum length of an IPv6 address isn't 39 characters, but 45:
   https://stackoverflow.com/a/166157

 - Also adjusted the testsuite accordingly.
@Traumflug
Copy link
Contributor

This should be fixed with e0f00a0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants