De-referer now no longer de-refers own links, no more entities in text-only emails
[mailer.git] / inc / functions.php
index d356add7d7f8d942edaad8693aad4c6faa212514..b6b212fb72ba2764fe1d9da321d660103f5b5bf2 100644 (file)
@@ -474,7 +474,7 @@ function SEND_RAW_EMAIL ($to, $subject, $msg, $from) {
                        $mail->WordWrap   = 70;
                        $mail->IsHTML(true);
                } else {
-                       $mail->Body       = $msg;
+                       $mail->Body       = html_entity_decode($msg);
                }
                $mail->AddAddress($to, "");
                $mail->AddReplyTo(WEBMASTER,MAIN_TITLE);
@@ -483,7 +483,7 @@ function SEND_RAW_EMAIL ($to, $subject, $msg, $from) {
                $mail->Send();
        } else {
                // Use legacy mail() command
-               @mail($to, $subject, $msg, $from);
+               @mail($to, $subject, html_entity_decode($msg), $from);
        }
 }
 //
@@ -591,7 +591,13 @@ function TRANSLATE_COMMA ($dotted, $cut=true) {
 
 //
 function DEREFERER ($URL) {
-       $URL = URL."/modules.php?module=loader&url=".urlencode(base64_encode(gzcompress($URL)));
+       // Don't de-refer our own links!
+       if (substr($URL, 0, strlen(URL)) != URL) {
+               // De-refer this link
+               $URL = URL."/modules.php?module=loader&url=".urlencode(base64_encode(gzcompress($URL)));
+       } // END - if
+
+       // Return link
        return $URL;
 }