Browse code

extract more HTML references from use with FOLLOWURL

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1041 77e5149b-7576-45b1-b177-96237e5ba77b

Trog authored on 2004/10/27 17:32:37
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Oct 27 09:30:47 BST 2004 (trog)
2
+-----------------------------------
3
+  * libclamav/htmlnorm.c: extract more HTML references from use with FOLLOWURL
4
+
1 5
 Wed Oct 27 07:36:49 BST 2004 (njh)
2 6
 ----------------------------------
3 7
  * libclamav/untar.c:	Handle links to another file already archived, patch
... ...
@@ -781,11 +781,27 @@ static int cli_html_normalise(int fd, m_area_t *m_area, const char *dirname, tag
781 781
 						in_script = TRUE;
782 782
 					}
783 783
 					html_output_tag(file_buff_script, tag, &tag_args);
784
-				} else if (hrefs && strcmp(tag, "a") == 0) {
785
-					arg_value = html_tag_arg_value(&tag_args, "href");
786
-					if (arg_value && strlen(arg_value) > 0) {
787
-						html_tag_arg_add(hrefs, "href", arg_value);
788
-					}
784
+				} else if (hrefs) {
785
+					if (strcmp(tag, "a") == 0) {
786
+						arg_value = html_tag_arg_value(&tag_args, "href");
787
+						if (arg_value && strlen(arg_value) > 0) {
788
+							html_tag_arg_add(hrefs, "href", arg_value);
789
+						}
790
+					} else if (strcmp(tag, "img") == 0) {
791
+						arg_value = html_tag_arg_value(&tag_args, "src");
792
+						if (arg_value && strlen(arg_value) > 0) {
793
+							html_tag_arg_add(hrefs, "src", arg_value);
794
+						}
795
+						arg_value = html_tag_arg_value(&tag_args, "dynsrc");
796
+						if (arg_value && strlen(arg_value) > 0) {
797
+							html_tag_arg_add(hrefs, "dynsrc", arg_value);
798
+						}
799
+					} else if (strcmp(tag, "iframe") == 0) {
800
+						arg_value = html_tag_arg_value(&tag_args, "src");
801
+						if (arg_value && strlen(arg_value) > 0) {
802
+							html_tag_arg_add(hrefs, "iframe", arg_value);
803
+						}
804
+					}						
789 805
 				}
790 806
 				html_tag_arg_free(&tag_args);
791 807
 				break;