X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fhtml_mail_functions.php;h=f7a34e0298c62265c4641fb115faea5957fa0644;hp=ee0f7bde321cda3d1dce7073f6c4a598b57e2a7a;hb=4cec044b57773e28423261c71f918f3e22ca8a75;hpb=3f51c40f4fede87228216f9285b745a339e3891d diff --git a/inc/libs/html_mail_functions.php b/inc/libs/html_mail_functions.php index ee0f7bde32..f7a34e0298 100644 --- a/inc/libs/html_mail_functions.php +++ b/inc/libs/html_mail_functions.php @@ -1,7 +1,7 @@ ', $test)) { $check = strtolower(substr($test, strpos($test, '<') + 1, strpos($test, '>') - strpos($test, '<') - 1)); $check = str_replace('/', '', $check); if (!in_array($check, $GLOBALS['html_tags'])) { // Invalid tag found! - return ""; + return ''; } $test = substr($test, strpos($test, '>') + 1); } // Return tested code return $html; } + // -function HTML_INSERT_URLS ($text) { +function insertUrlsIntoHtml ($text) { $test = $text; // First replace URLs... @@ -81,7 +82,7 @@ function HTML_INSERT_URLS ($text) { } // END - foreach // Now replace the URL against anchor container and pray... - $text = substr($text, 0, strpos($text, $check2))."".$check."".substr($text, strpos($text, $check2) + strlen($check)); + $text = substr($text, 0, strpos($text, $check2))."".$check."".substr($text, strpos($text, $check2) + strlen($check)); // Finally remove the url from testing string (or we have a loop and maybe server overload!) $test = substr($test, strpos($test, $check) + strlen($check)); @@ -117,7 +118,7 @@ function HTML_INSERT_URLS ($text) { } // END - if // And now go forward... - $idx = 0; + $idx = '0'; while ($idx < strlen($test)) { $check = substr($test, $idx, 1); if ((!in_array($check, $GLOBALS['valid_email_chars'])) && ($check != '@')) { @@ -143,19 +144,19 @@ function HTML_INSERT_URLS ($text) { $text = ''; $PARTS[] = $test; foreach ($PARTS as $part) { $text .= $part; - } + } // END - foreach // Replace new-lines agains
-s and finally compile possible own HTML tags out... - return COMPILE_CODE(str_replace("\n", "
\n", $text)); + return compileCode(str_replace("\n", "
\n", $text)); } // Sends a HTML mail to the user function sendHtmlEmail($to, $subject, $message, $FROM) { - if (EXT_IS_ACTIVE('html_mail')) { + if (isExtensionActive('html_mail')) { // Send mail away as HTML - $FROM = "Content-Type: text/html\n" . $FROM; + $FROM = "Content-Type: text/html; charset=UTF-8\n" . $FROM; sendEmail($to, $subject, $message, 'N', $FROM); - } + } // END - if } //