aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/html.c1
-rw-r--r--src/url.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/html.c b/src/html.c
index 8f5664079..891962643 100644
--- a/src/html.c
+++ b/src/html.c
@@ -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);
diff --git a/src/url.c b/src/url.c
index 6f17f1a6d..e11d30f82 100644
--- 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) {