Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-14453

Brackets in URL disappear after adding a product to shopping cart two times in a row

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Medium Medium
    • None
    • 4.1.0alpha2
    • Legacy > Webshop
    • 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!

      Attachments

        Activity

          People

            unknown unknown
            l0rdj l0rdj
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: