X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffunctions.php;h=6f668fc188a1775352b19ec101e1b93074eb1597;hp=f071322d043c171fd85417d3dd4f23f0885ee8b3;hb=595124165eb35633520ee0c8e7d5196ba515c00f;hpb=397eb5dee2611cfaa1ff494d73e6785b88109cd6 diff --git a/inc/functions.php b/inc/functions.php index f071322d04..6f668fc188 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -67,7 +67,7 @@ function OUTPUT_HTML ($HTML, $NEW_LINE = true) { // Do we have HTML-Code here? if (!empty($HTML)) { // Yes, so we handle it as you have configured - switch (OUTPUT_MODE) + switch (constant('OUTPUT_MODE')) { case "render": // That's why you don't need any \n at the end of your HTML code... :-) @@ -97,7 +97,7 @@ function OUTPUT_HTML ($HTML, $NEW_LINE = true) { default: // Huh, something goes wrong or maybe you have edited config.php ??? - DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid renderer %s detected.", OUTPUT_MODE)); + DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid renderer %s detected.", constant('OUTPUT_MODE'))); mxchange_die("{!FATAL_ERROR!}: {!LANG_NO_RENDER_DIRECT!}"); break; } @@ -152,7 +152,7 @@ function OUTPUT_HTML ($HTML, $NEW_LINE = true) { // Output code here, DO NOT REMOVE! ;-) OUTPUT_RAW($OUTPUT); - } elseif ((OUTPUT_MODE == "render") && (!empty($OUTPUT))) { + } elseif ((constant('OUTPUT_MODE') == "render") && (!empty($OUTPUT))) { // Rewrite links when rewrite extension is active if ((EXT_IS_ACTIVE("rewrite")) && ($CSS != "1") && ($CSS != "-1")) { $OUTPUT = REWRITE_LINKS($OUTPUT); @@ -459,7 +459,7 @@ Message : ".$MSG." SEND_RAW_EMAIL($TO, $SUBJECT, $MSG, $FROM); } elseif ($HTML == "N") { // Problem found! - SEND_RAW_EMAIL(WEBMASTER, "[PROBLEM:]".$SUBJECT, $MSG, $FROM); + SEND_RAW_EMAIL(constant('WEBMASTER'), "[PROBLEM:]".$SUBJECT, $MSG, $FROM); } } @@ -485,16 +485,16 @@ function SEND_RAW_EMAIL ($to, $subject, $msg, $from) { $mail->IsSMTP(); $mail->SMTPAuth = true; - $mail->Host = SMTP_HOSTNAME; + $mail->Host = constant('SMTP_HOSTNAME'); $mail->Port = 25; - $mail->Username = SMTP_USER; - $mail->Password = SMTP_PASSWORD; + $mail->Username = constant('SMTP_USER'); + $mail->Password = constant('SMTP_PASSWORD'); if (empty($from)) { $mail->From = constant('WEBMASTER'); } else { $mail->From = $from; } - $mail->FromName = MAIN_TITLE; + $mail->FromName = constant('MAIN_TITLE'); $mail->Subject = $subject; if ((EXT_IS_ACTIVE("html_mail")) && (strip_tags($msg) != $msg)) { $mail->Body = $msg; @@ -505,9 +505,9 @@ function SEND_RAW_EMAIL ($to, $subject, $msg, $from) { $mail->Body = html_entity_decode($msg); } $mail->AddAddress($to, ""); - $mail->AddReplyTo(WEBMASTER,MAIN_TITLE); - $mail->AddCustomHeader("Errors-To:".WEBMASTER); - $mail->AddCustomHeader("X-Loop:".WEBMASTER); + $mail->AddReplyTo(constant('WEBMASTER'), constant('MAIN_TITLE')); + $mail->AddCustomHeader("Errors-To:".constant('WEBMASTER')); + $mail->AddCustomHeader("X-Loop:".constant('WEBMASTER')); $mail->Send(); } else { // Use legacy mail() command @@ -751,15 +751,12 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") { // Default "nickname" if extension is not installed $nick = "---"; - // Keept for backward-compatiblity (please replace these variables against our new {!CONST!} syntax!) - // No longer used: $MAIN_TITLE = MAIN_TITLE; $URL = constant('URL'); $WEBMASTER = constant('WEBMASTER'); - // Prepare IP number and User Agent $REMOTE_ADDR = GET_REMOTE_ADDR(); $HTTP_USER_AGENT = GET_USER_AGENT(); // Default admin - $ADMIN = MAIN_TITLE; + $ADMIN = constant('MAIN_TITLE'); // Is the admin logged in? if (IS_ADMIN()) { @@ -1955,7 +1952,7 @@ function VALIDATE_URL ($URL, $compile=true) { return (((substr($URL, 0, 7) == "http://") || (substr($URL, 0, 8) == "https://")) && (strlen($URL) >= 12)); } // -function MEMBER_ACTION_LINKS($uid, $status="") { +function MEMBER_ACTION_LINKS ($uid, $status = "") { // Define all main targets $TARGETS = array("del_user", "edit_user", "lock_user", "add_points", "sub_points"); @@ -2400,10 +2397,15 @@ function merge_array ($array1, $array2) { return array_merge($array1, $array2); } elseif (is_array($array1)) { // Return left array + DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("array2 is not an array. array != %s", gettype($array2))); return $array1; + } elseif (is_array($array2)) { + // Return right array + DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("array1 is not an array. array != %s", gettype($array1))); + return $array2; } - // Something wired happened here... + // Both are not arrays print(__FUNCTION__.":
");
 	debug_print_backtrace();
 	die("
");