X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fnewsletter_functions.php;h=5dae6a1419aeba69feb4c362eac403011400e874;hb=325bb973c136c921d0c36384ca9655aa7744283e;hp=2c77e3a802cb06159ceccc11ae9673143c4549ab;hpb=3f51c40f4fede87228216f9285b745a339e3891d;p=mailer.git diff --git a/inc/libs/newsletter_functions.php b/inc/libs/newsletter_functions.php index 2c77e3a802..5dae6a1419 100644 --- a/inc/libs/newsletter_functions.php +++ b/inc/libs/newsletter_functions.php @@ -1,10 +1,10 @@ ', $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 ""; - } - $test = substr($test, strpos($test, '>') + 1); - } - // Return tested code - return $html; -} - -// -function NL_INSERT_URLS ($text) { +function insertNewsletterUrls ($text) { $test = $text; // First replace URLs... @@ -83,7 +55,7 @@ function NL_INSERT_URLS ($text) { } // END - foreach // Now replace the URL against anchor container and pray... - $text = substr($text, 0, strpos($text, $check2)) . DEREFERER($check) . substr($text, strpos($text, $check2) + strlen($check)); + $text = substr($text, 0, strpos($text, $check2)) . generateDerefererUrl($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)); @@ -120,7 +92,7 @@ function NL_INSERT_URLS ($text) { } // 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 != '@')) { @@ -149,24 +121,24 @@ function NL_INSERT_URLS ($text) { } // Compile possible own HTML tags out... - return COMPILE_CODE($text); + return compileCode($text); } -// -function SEND_NEWSLETTER ($to, $subject, $message, $mode) { +// Wrapper for sending newsletter and wrapping URLs / HTML mail +function sendNewsletter ($to, $subject, $message, $mode) { // Send mail away as HTML - if (REQUEST_POST('auto_urls') == 'Y') { + if (postRequestParameter('auto_urls') == 'Y') { // Automatically insert URLs into newsletter - if ((EXT_IS_ACTIVE('html_mail')) && ($mode == 'html')) { + if ((isExtensionActive('html_mail')) && ($mode == 'html')) { // Send HTML mail - sendEmail($to, $subject, HTML_INSERT_URLS($message), 'Y'); + sendEmail($to, $subject, insertUrlsIntoHtml($message), 'Y'); } else { // Send normal mail - sendEmail($to, $subject, NL_INSERT_URLS($message), 'N'); + sendEmail($to, $subject, insertNewsletterUrls($message), 'N'); } } else { // Regular send-out - if ((EXT_IS_ACTIVE('html_mail')) && ($mode == 'html')) { + if ((isExtensionActive('html_mail')) && ($mode == 'html')) { sendEmail($to, $subject, $message, 'Y'); } else { sendEmail($to, $subject, $message, 'N');