Fork me on GitHub

FIX: ShortURLs breaks [PayPalCart]  Bottom

  • While developing an IPN solution for PayPalCart (not yet released), I stumbled across a problem when using ShortURLs. Apparently, when using submitting relative URLs (for, example, the PayPalCart thankyou page in the PayPal form variable set), ShortURLs (almost every deployment I've seen) truncates out the site baseurl, leaving only a relative URL for PayPal to return customers to.

    Well, my PayPalCart thankyou page isn't on PayPal, it's on MY site.

    Sooooo...

    To utilize ShortURLs with PayPalCart (other modules will, of course, be affected similarly), a change needs to be made to the ShortURLs function that translates the URLs. The baseurl, in effect, needs to be added back in, or retained.

    Where original Out var:
    '"$1+$2.phtml"'
    Change it to:
    '"'.$base_url.'$1+$2.phtml"'

    Do that for all of the Out vars to fix the issue.

    More notes posted in MirageLab Forums
  • Ohh... cool. I hadn't thought of that issue. (Another of my "bugs" that demonstrates that all of the short URL implementations are derivative of Simple URLs. :) )

    I've always considered that relative URL's is better. Other than this rather specialized situation, is there any reason for not using relative?
  • ..shouldn't the baseurl be added to the return URL in the paypal form?

    ..maybe I didn't read carefully enough.. or the gears aren't turning well wink

    -IR
  • InvalidResponse

    ..shouldn't the baseurl be added to the return URL in the paypal form?


    The URL generated for the return URL in the paypal form starts off with the baseurl attached, but running it through the ShortURLs translator strips it off.

This list is based on users active over the last 60 minutes.