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":
} else {
// Output error message
include(PATH."inc/header.php");
- OUTPUT_HTML(LOAD_URL_ERROR_1.$URL.LOAD_URL_ERROR_2);
+ LOAD_TEMPLATE("redirect_url", false, str_replace("&", "&", $URL));
include(PATH."inc/footer.php");
}
exit();
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
}
//
-function MXCHANGE_OPEN($script) {
+function MXCHANGE_OPEN ($script) {
// Compile the script name
$script = COMPILE_CODE($script);
// Open connection
$fp = @fsockopen($host, 80, $errno, $errdesc, 30);
- if (!$fp)
- {
+ if (!$fp) {
// Failed!
return array("", "", "");
}
return $EMAIL;
}
// Generate a hash for extra-security for all passwords
-function generateHash($plainText, $salt = "") {
+function generateHash ($plainText, $salt = "") {
global $_CONFIG, $_SERVER;
// Is the required extension "sql_patches" there?
//* DEBUG: */ die($passHash."<br>".$newHash." (".strlen($newHash).")");
$ret = generateHash($newHash, $_CONFIG['master_salt']);
+ } else {
+ // Hash it simple
+ //* DEBUG: */ echo "--".$passHash."--<br />\n";
+ $ret = md5($passHash);
+ //* DEBUG: */ echo "++".$ret."++<br />\n";
}
// Return result