]> source.dussan.org Git - rspamd.git/commitdiff
* Fix chartable module in utf mode
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 5 Jul 2010 14:25:05 +0000 (18:25 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 5 Jul 2010 14:25:05 +0000 (18:25 +0400)
src/message.c
src/plugins/chartable.c

index ef3cc02e69f99b5e4f1e2995177598faa4d03bdb..834f36f450ad9cef5f4454c975dc630c4b281467 100644 (file)
@@ -548,7 +548,7 @@ process_text_part (struct worker_task *task, GByteArray * part_content, GMimeCon
                text_part->html_urls = g_tree_new ((GCompareFunc) g_ascii_strcasecmp);
                text_part->urls = g_tree_new ((GCompareFunc) g_ascii_strcasecmp);
 
-               text_part->content = strip_html_tags (task, task->task_pool, text_part, part_content, NULL);
+               text_part->content = strip_html_tags (task, task->task_pool, text_part, text_part->orig, NULL);
 
                if (text_part->html_nodes == NULL) {
                        url_parse_text (task->task_pool, task, text_part, FALSE);
index e5b5893fb5c8cdf18a7a65ab1ca3b6d85320d435..785cd3a598ca45bca42f3f20a88d1f1a622bd962 100644 (file)
@@ -135,7 +135,7 @@ check_part (struct mime_text_part *part, gboolean raw_mode)
        else {
                while (remain > 0) {
                        c = g_utf8_get_char_validated (p, remain);
-                       if (c == (gunichar) - 2 || c == (gunichar) - 1) {
+                       if (c == (gunichar) -2 || c == (gunichar) -1) {
                                /* Invalid characters detected, stop processing */
                                return FALSE;
                        }
@@ -147,12 +147,12 @@ check_part (struct mime_text_part *part, gboolean raw_mode)
 
                        if (remain > 0) {
                                t = g_utf8_get_char_validated (p, remain);
-                               if (c == (gunichar) - 2 || c == (gunichar) - 1) {
+                               if (t == (gunichar) -2 || t == (gunichar) -1) {
                                        /* Invalid characters detected, stop processing */
                                        return FALSE;
                                }
                                sct = g_unichar_get_script (t);
-                               if (g_unichar_isalnum (c) && g_unichar_isalnum (t)) {
+                               if (g_unichar_isalpha (c) && g_unichar_isalpha (t)) {
                                        /* We have two unicode alphanumeric characters, so we can check its script */
                                        if (sct != scc) {
                                                mark++;