Description
Proconditions:
- Create a product
- Email to Friend set to "Enabled" in configurations
- Limit Sending By set to "IP address"
- Allow for Guests set to "Yes" (not nessesary but if you don't you have create customer before.)
Steps To Reproduce:
- Go to storfront to the product page
- Click on send email to friend icon
- Fill all required fields and click "Send" button
- Check sendfriend_log table
(/) Expected Result:
Ip value should be converted to biginteger value
(x) Actual Result:
Ip value is not converted properly and it cuted. F.e. If your ip value 127.0.0.1 it will be cutted to 1270.
(!) Notice:
It can cause problems with sendFriend IP validation if different customers will have similar IP addresses
(!) Issue caused by:
\Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::getRemoteAddress method does not work corectly. Because if it cahced the value one time it will always return cached value despite input parameter
(!)Notice:
Bug blocked this test \Magento\SendFriend\Model\SendFriendTest::testisExceedLimitByIp please unskip after bug fixing
Note from comments:
{quote}Once issue with 'Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::getRemoteAddress' will be fixed please remove ip2long conversion in \Magento\SendFriend\Model\ResourceModel\SendFriend::addSendItem and make sure this case covered with integration tests{quote}
Metadata
Metadata
Assignees
Labels
Type
Projects
Status