X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Ffunctions.php;h=e24be85a2de601d7eb0a4784f70a6b90418b9051;hb=dff82554761a7fe1a34d3ce2d4922b4b1f3cd6b9;hp=1ef5165a5a35d301c484bb8fce92f98306cdc59e;hpb=5fec9d9db95e2b70f63e5749515a2cf8c99b6791;p=mailer.git diff --git a/inc/functions.php b/inc/functions.php index 1ef5165a5a..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": @@ -930,7 +934,7 @@ function LOAD_URL($URL, $addUrlData=true) { } else { // Output error message include(PATH."inc/header.php"); - LOAD_TEMPLATE("redirect_url", false, $URL); + LOAD_TEMPLATE("redirect_url", false, str_replace("&", "&", $URL)); include(PATH."inc/footer.php"); } exit(); @@ -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 @@ -1635,7 +1645,7 @@ function ADD_EMAIL_NAV($PAGES, $offset, $show_form, $colspan, $return=false) { } // -function MXCHANGE_OPEN($script) { +function MXCHANGE_OPEN ($script) { // Compile the script name $script = COMPILE_CODE($script); @@ -1659,8 +1669,7 @@ function MXCHANGE_OPEN($script) { // Open connection $fp = @fsockopen($host, 80, $errno, $errdesc, 30); - if (!$fp) - { + if (!$fp) { // Failed! return array("", "", ""); }