Heacy rewrite/cleanup:
[mailer.git] / inc / mails / doubler_mails.php
index 92606bfba89f384615ec89d93ae5f38633684f29..1783c69cb15b16403a9927277d8094ac8bc5c098 100644 (file)
@@ -167,7 +167,7 @@ if ((($totalCount > 0) && (getConfig('doubler_sent_all') == 'Y')) || ((sqlNumRow
                        if ($content['userid'] != getDoublerUserid()) {
                                // Add points
                                initReferralSystem();
-                               addPointsThroughReferralSystem(sprintf("doubler_%s", strtolower(getDoublerSendMode())), $content['userid'], $content['points']);
+                               addPointsThroughReferralSystem(sprintf('doubler_%s', strtolower(getDoublerSendMode())), $content['userid'], $content['points']);
                        } // END - if
 
                        // Set entry as "payed"
@@ -184,7 +184,7 @@ if ((($totalCount > 0) && (getConfig('doubler_sent_all') == 'Y')) || ((sqlNumRow
                        } // END - if
 
                        // Exclude also webmaster's id in taking points from webmaster's account
-                       if (($userPoints > 0) && ($userPoints >= $content['points']) && ($okay === FALSE) && (getDoublerUserid() > 0) && ($content['userid'] != getDoublerUserid())) {
+                       if (($userPoints > 0) && ($userPoints >= $content['points']) && ($okay === FALSE) && (isValidId(getDoublerUserid())) && ($content['userid'] != getDoublerUserid())) {
                                // Subtract points
                                $okay = subtractPoints('doubler_payout', getDoublerUserid(), $content['points']);
                        } // END - if