1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed PayPal processor error: || instead of &&

Discussion in 'Resolved Bug Reports' started by Arty, Sep 23, 2013.

  1. Arty

    Arty Well-Known Member

    In library/XenForo/UserUpgradeProcessor/PayPal.php line 250
    Code:
              $paymentAmountPassed = $paymentAmountPassed || (
                 round($this->_filtered['mc_gross'], 2) == round($cost, 2)
                 || strtolower($this->_filtered['mc_currency']) == $currency
               );
    
    It should be && on third line of that code instead of || because condition should check if both currency and cost match, not just one of them.

    Correct code
    Code:
              $paymentAmountPassed = $paymentAmountPassed || (
                 round($this->_filtered['mc_gross'], 2) == round($cost, 2)
                 && strtolower($this->_filtered['mc_currency']) == $currency
               );
    
     
  2. Mike

    Mike XenForo Developer Staff Member

    Indeed, good catch. (Only applied with upgrade extensions, BTW.)
     

Share This Page