]> git.mxchange.org Git - mailer.git/commitdiff
Fixes and other improvements
authorRoland Häder <roland@mxchange.org>
Wed, 23 Jan 2013 16:36:30 +0000 (16:36 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 23 Jan 2013 16:36:30 +0000 (16:36 +0000)
inc/extensions/ext-blacklist.php
inc/libs/html_mail_functions.php
inc/modules/member/what-order.php

index a34fdeaed53ad79a5da74a589e862aed7ff9e908..988102d3c15171061f040af8351296b0039709dc 100644 (file)
@@ -68,16 +68,16 @@ INDEX (`pool_id`)",
 
                // Add admin menu
                addAdminMenuSql('setup', 'config_blacklist', 'Sperrlisten', 'Einstellungen zu den Sperrlisten.', 8);
-               addAdminMenuSql('misc', 'list_blacklist', 'Sperrlisten...', 'Zeigt gesperrte Email-Adressen und/oder URLs an.', 3);
+               addAdminMenuSql('misc', 'list_blacklist', 'Sperrlisten...', 'Zeigt gesperrte Email-Adressen, IP-Adressen, URLs und vieles mehr an.', 3);
 
                // Add configuration
                addConfigAddSql('email_blacklist', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
                addConfigAddSql('url_blacklist', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
 
                // Register filters
-               registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'CHECK_EMAIL_BLACKLISTED', FALSE, TRUE, isExtensionDryRun());
-               registerFilter(__FILE__, __LINE__, 'pre_update_user_data', 'CHECK_EMAIL_BLACKLISTED', FALSE, TRUE, isExtensionDryRun());
-               registerFilter(__FILE__, __LINE__, 'post_email_blacklisted', 'LOG_EMAIL_BLACKLISTED', FALSE, TRUE, isExtensionDryRun());
+               registerFilter(__FILE__, __LINE__, 'pre_user_registration' , 'CHECK_EMAIL_BLACKLISTED', FALSE, TRUE, isExtensionDryRun());
+               registerFilter(__FILE__, __LINE__, 'pre_update_user_data'  , 'CHECK_EMAIL_BLACKLISTED', FALSE, TRUE, isExtensionDryRun());
+               registerFilter(__FILE__, __LINE__, 'post_email_blacklisted', 'LOG_EMAIL_BLACKLISTED'  , FALSE, TRUE, isExtensionDryRun());
                break;
 
        case 'remove': // Do stuff when removing extension
@@ -85,12 +85,12 @@ INDEX (`pool_id`)",
                addDropTableSql('blacklist');
 
                // Remove menu
-               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_blacklist', 'list_blacklist') LIMIT 1");
+               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('config_blacklist', 'list_blacklist')");
 
                // Unregister filters
-               unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'CHECK_EMAIL_BLACKLISTED', TRUE, isExtensionDryRun());
-               unregisterFilter(__FILE__, __LINE__, 'pre_update_user_data', 'CHECK_EMAIL_BLACKLISTED', TRUE, isExtensionDryRun());
-               unregisterFilter(__FILE__, __LINE__, 'post_email_blacklisted', 'LOG_EMAIL_BLACKLISTED', FALSE, TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'pre_user_registration' , 'CHECK_EMAIL_BLACKLISTED', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'pre_update_user_data'  , 'CHECK_EMAIL_BLACKLISTED', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'post_email_blacklisted', 'LOG_EMAIL_BLACKLISTED'  , TRUE, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 62bc294d941e195bd9e7668648062492b832de36..4858e620383d09e1b9442fe1d2e12faea4b4502f 100644 (file)
@@ -59,7 +59,8 @@ function checkHtmlTags ($html) {
                $check = str_replace('/', '', $check);
                if (!in_array($check, $GLOBALS['html_tags'])) {
                        // Invalid tag found
-                       return '';
+                       $html = '';
+                       break;
                } // END - if
                $test = substr($test, strpos($test, '>') + 1);
        } // END - while
index f0d56c922af0e6d8fbffa81a0d71af5104a97af6..4ee6eab5c19548cab986d991bae13c65cdfe0f25 100644 (file)
@@ -150,10 +150,13 @@ LIMIT 1",
                        // HTML or regular text mail?
                        if (postRequestElement('html') == 'Y') {
                                // Chek for valid HTML tags
-                               setPostRequestElement('text', checkHtmlTags(postRequestElement('text')));
+                               $checked = checkHtmlTags(postRequestElement('text')));
 
                                // Maybe invalid tags found?
-                               if (!isPostRequestElementSet('text')) $data['url'] = 'modules.php?module=login&amp;what=order&amp;code=' . getCode('INVALID_TAGS') . '&amp;id=' . $data['id'];
+                               if (empty($checked)) {
+                                       // Invalid HTML tags found
+                                       $data['url'] = 'modules.php?module=login&amp;what=order&amp;code=' . getCode('INVALID_TAGS') . '&amp;id=' . $data['id'];
+                               } // END - if
                        } else {
                                // Remove any HTML code
                                setPostRequestElement('text', str_replace(array('<', '>'), array('{OPEN_HTML}', '{CLOSE_HTML}'), postRequestElement('text')));