X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffunctions.php;h=d1dffd29b99c1eb04bfb7dfe199127fa17756e00;hb=032c58de69aa2ebc83c46d62af9c14ead90004b9;hp=3cdabf7e3e09ff0c32816a90d0a133e6ad209b27;hpb=feebd0199748544fe8c930b70e97452001a13f76;p=mailer.git
diff --git a/inc/functions.php b/inc/functions.php
index 3cdabf7e3e..d1dffd29b9 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
@@ -1780,7 +1790,7 @@ function CREATE_EMAIL_LINK($email, $table="admins") {
if ((EXT_IS_ACTIVE("admins")) && ($table == "admins")) {
// Create email link for contacting admin in guest area
$EMAIL = ADMINS_CREATE_EMAIL_LINK($email);
- } elseif ((GET_EXT_VERSION("user") >= "0.3.3") && ($table == "user_data")) {
+ } elseif ((EXT_IS_ACTIVE("user", true)) && (GET_EXT_VERSION("user") >= "0.3.3") && ($table == "user_data")) {
// Create email link for contacting a member within admin area (or later in other areas, too?)
$EMAIL = USER_CREATE_EMAIL_LINK($email);
} elseif ((EXT_IS_ACTIVE("sponsor")) && ($table == "sponsor_data")) {
@@ -1795,7 +1805,7 @@ function CREATE_EMAIL_LINK($email, $table="admins") {
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?
@@ -1987,6 +1997,11 @@ function generatePassString($passHash) {
//* DEBUG: */ die($passHash."
".$newHash." (".strlen($newHash).")");
$ret = generateHash($newHash, $_CONFIG['master_salt']);
+ } else {
+ // Hash it simple
+ //* DEBUG: */ echo "--".$passHash."--
\n";
+ $ret = md5($passHash);
+ //* DEBUG: */ echo "++".$ret."++
\n";
}
// Return result