define('SERVER_URL', "http://www.mxchange.org");
// This current patch level
-define('CURR_SVN_REVISION', "368");
+define('CURR_SVN_REVISION', "369");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
}
// Send mail out to an email address
-function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML='N', $FROM="") {
+function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = 'N', $FROM = "") {
// Compile subject line (for POINTS constant etc.)
- $eval = "\$SUBJECT = \"".COMPILE_CODE(addslashes($SUBJECT))."\";";
+ $eval = "\$SUBJECT = html_entity_decode(\"".COMPILE_CODE(addslashes($SUBJECT))."\");";
eval($eval);
- $SUBJECT = html_entity_decode($SUBJECT);
// Set from header
if ((!eregi("@", $TO)) && ($TO > 0)) {
ADD_MESSAGE_TO_BOX($TO, $SUBJECT, $MSG, $HTML);
return;
} else {
+ // Load email address
$result_email = SQL_QUERY_ESC("SELECT email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", array(bigintval($TO)), __FILE__, __LINE__);
- list($TO) = SQL_FETCHROW($result_email);
+
+ // Does the user exist?
+ if (SQL_NUMROWS($result_email)) {
+ // Load email address
+ list($TO) = SQL_FETCHROW($result_email);
+ } else {
+ // Set webmaster
+ $TO = WEBMASTER;
+ }
+
+ // Free result
SQL_FREERESULT($result_email);
}
- } elseif ($TO == 0) {
+ } elseif ("$TO" == "0") {
// Is the webmaster!
$TO = WEBMASTER;
}
- // Not in PHPMailer-Mode
+ // Check for PHPMailer or debug-mode
if (!CHECK_PHPMAILER_USAGE()) {
+ // Not in PHPMailer-Mode
if (empty($FROM)) {
// Load email header template
$FROM = LOAD_EMAIL_TEMPLATE("header");
}
}
+ // Compile "TO"
+ $eval = "\$TO = \"".COMPILE_CODE(addslashes($TO))."\";";
+ eval($eval);
+
// Fix HTML parameter (default is no!)
if (empty($HTML)) $HTML = "N";
if (isBooleanConstantAndTrue('DEBUG_MODE')) {
// Send mail as HTML away
SEND_HTML_EMAIL($TO, $SUBJECT, $MSG, $FROM);
} elseif (!empty($TO)) {
- // Compile email
- $TO = COMPILE_CODE($TO);
-
// Send Mail away
SEND_RAW_EMAIL($TO, COMPILE_CODE($SUBJECT), COMPILE_CODE($MSG), $FROM);
} elseif ($HTML == "N") {