]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/newsletter_functions.php
More misc fixes and rewrites (sorry, lame description)
[mailer.git] / inc / libs / newsletter_functions.php
index 16a28db280747a41ebc2f4f1f259137342e97143..2c77e3a802cb06159ceccc11ae9673143c4549ab 100644 (file)
@@ -56,14 +56,14 @@ function NL_ADD_VALID_TAGS () {
 //
 function NL_CHECK_TAGS ($html) {
        $test = stripslashes($html);
-       while (ereg("<", $test) && ereg(">", $test)) {
-               $check = strtolower(substr($test, strpos($test, "<") + 1, strpos($test, ">") - strpos($test, "<") - 1));
+       while (ereg('<', $test) && ereg('>', $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);
+               $test = substr($test, strpos($test, '>') + 1);
        }
        // Return tested code
        return $html;
@@ -97,8 +97,8 @@ function NL_INSERT_URLS ($text) {
 
        // ... what will the email address be out the @... ;-)
        $PARTS = array();
-       while (ereg("@", $test)) {
-               $pos = strpos($test, "@");
+       while (ereg('@', $test)) {
+               $pos = strpos($test, '@');
                $test2 = substr($test, 0, $pos);
 
                // First check backwards
@@ -123,7 +123,7 @@ function NL_INSERT_URLS ($text) {
                $idx = 0;
                while ($idx < strlen($test)) {
                        $check = substr($test, $idx, 1);
-                       if ((!in_array($check, $GLOBALS['valid_email_chars'])) && ($check != "@")) {
+                       if ((!in_array($check, $GLOBALS['valid_email_chars'])) && ($check != '@')) {
                                // Char found so end here again
                                break;
                        }
@@ -136,7 +136,7 @@ function NL_INSERT_URLS ($text) {
                }
 
                // Now replace the email against anchor with mailto and pray...
-               $PARTS[] = $check2.$check;
+               $PARTS[] = $check2 . $check;
 
                // Remove email from testing string (see above why...)
                $test = substr($test, strlen($check));