Details
-
Bug
-
Resolution: Duplicate
-
Medium
-
None
-
4.1.0alpha2
-
None
Description
After adding a product to shopping cart, browser is redirected to the same
page, e.g. http://site.com/en/Categories/Batteries/(mnfc)/1190718117CANON.
But when we try to add one more product right away, the URL of the target
page becomes
http://site.com/en/Categories/Batteries/%2528mnfc%2529/1190718117CANON
So we dig into the kernel and found out that address of the page to be
opened afterwards is saved in the session as FromPage variable. After a
product is added to the cart, it gets url encoded (special chars are
replaced with %Ñ…Ñ…) and then used as a redirect address. It is automatically
decoded by Firefox to display correct page url in the browser, but when
session variable FromPage is stored, it is not decoded.
What happens the next time we try the trick again is already encoded url
gets encoded again!
The solution is simple:
File kernel/shop/basket.php, line 55:
$http->setSessionVariable( "FromPage", $_SERVER['HTTP_REFERER'] );
needs to be replaced by
$http->setSessionVariable( "FromPage", eZURI::decodeURL( $_SERVER['HTTP_REFERER'] ) );
We tried the fix and it works all right!