]> source.dussan.org Git - rspamd.git/commitdiff
* Strip url line from spaces
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 30 Jul 2009 14:42:36 +0000 (18:42 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 30 Jul 2009 14:42:36 +0000 (18:42 +0400)
src/html.c
src/url.c

index 8f5664079fc1a5a5e5686d828ad0a1fa5afd503e..89196264324d898caaa8549e8795a34f282e5b97 100644 (file)
@@ -394,6 +394,7 @@ parse_tag_url (struct worker_task *task, struct mime_text_part *part, tag_id_t i
                
                url_text = memory_pool_alloc (task->task_pool, len + 1);
                g_strlcpy (url_text, c, len + 1);
+               g_strstrip (url_text);
                decode_entitles (url_text);
                url = memory_pool_alloc (task->task_pool, sizeof (struct uri));
                rc = parse_uri (url, url_text, task->task_pool);
index 6f17f1a6dca97544e84705fe18e9d55f6d41b07c..e11d30f820a2a5d79c5640831ef41f45d901d857 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -907,6 +907,7 @@ url_parse_text (memory_pool_t *pool, struct worker_task *task, struct mime_text_
                                        if (g_tree_lookup (is_html ? part->html_urls : part->urls, url_str) == NULL) {
                                                new = memory_pool_alloc (pool, sizeof (struct uri));
                                                if (new != NULL) {
+                                                       g_strstrip (url_str);
                                                        rc = parse_uri (new, url_str, pool);
                                                        if (rc != URI_ERRNO_EMPTY && rc != URI_ERRNO_NO_HOST) {
                                                                if (g_tree_lookup (is_html ? part->html_urls : part->urls, url_str) == NULL) {