X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffunctions.php;h=e24be85a2de601d7eb0a4784f70a6b90418b9051;hp=3cdabf7e3e09ff0c32816a90d0a133e6ad209b27;hb=898d17a09c66527b1e5d45149e23b88d42487c35;hpb=0da26ebf67e1a6c8e5ab5f23639c6abd99d84b2d diff --git a/inc/functions.php b/inc/functions.php index 3cdabf7e3e..e24be85a2d 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -786,7 +786,11 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0") { break; case "add-points": - $points = bigintval($_POST['points']); + if (isset($_POST['points'])) { + $points = bigintval($_POST['points']); + } else { + $points = __POINTS_VALUE; + } break; case "guest_request_confirm": @@ -1212,9 +1216,15 @@ function GEN_RANDOM_CODE($length, $code, $uid, $DATA="") return $return; } // Does only allow numbers -function bigintval($num) +function bigintval($num, $castValue = true) { - $ret = (int) preg_replace("/[^0123456789]/", "", $num); + // Filter all numbers out + $ret = preg_replace("/[^0123456789]/", "", $num); + + // Cast the value? + if ($castValue) $ret = (int) $ret; + + // Return result return $ret; } // Insert the code in $img_code into jpeg or PNG image