From 16611e0e7125e5fcee7073d7a95321e0577dc921 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 4 Oct 2008 14:19:17 +0000 Subject: [PATCH] De-referer now no longer de-refers own links, no more entities in text-only emails --- inc/databases.php | 2 +- inc/functions.php | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index 036d840348..67ad3e79aa 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -113,7 +113,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "448"); +define('CURR_SVN_REVISION', "449"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/functions.php b/inc/functions.php index d356add7d7..b6b212fb72 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -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; } -- 2.39.5