summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2006-03-27 01:04:56 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2006-03-27 01:04:56 +0000
commit3f979633b834b964895a4a398df4f67102ebc21f (patch)
tree7a6d19d67aa76b65be5c7286e9d98294587d4ba4
parent5ca28e5ef34faeb46a1b7bb9f7e8cd536f795e7c (diff)
downloadnetsurf-3f979633b834b964895a4a398df4f67102ebc21f.tar.gz
netsurf-3f979633b834b964895a4a398df4f67102ebc21f.tar.bz2
[project @ 2006-03-27 01:04:56 by jmb]
Reinstate checks for embedded content being the same as its parent (fixes 1456335) svn path=/import/netsurf/; revision=2196
-rw-r--r--render/box_construct.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/render/box_construct.c b/render/box_construct.c
index c972258c0..b3e5e879d 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -187,6 +187,7 @@ bool xml_to_box(xmlNode *n, struct content *c)
if (!convert_xml_to_box(n, c, c->data.html.style, &root,
&inline_container, 0, 0, 0))
return false;
+
if (!box_normalise_block(&root, c))
return false;
@@ -1304,6 +1305,10 @@ bool box_object(BOX_SPECIAL_PARAMS)
/* objects without data are ignored */
return true;
+ /* Don't include ourself */
+ if (strcmp(content->data.html.base_url, params->data) == 0)
+ return true;
+
/* codetype and type are MIME types */
if (!box_get_attribute(n, "codetype", params, &params->codetype))
return false;
@@ -1705,6 +1710,12 @@ bool box_iframe(BOX_SPECIAL_PARAMS)
if (!url)
return true;
+ /* Don't include ourself */
+ if (strcmp(content->data.html.base_url, url) == 0) {
+ free(url);
+ return true;
+ }
+
/* start fetch */
ok = html_fetch_object(content, url, box, 0,
content->available_width, 0, false, 0);
@@ -2326,6 +2337,10 @@ bool box_embed(BOX_SPECIAL_PARAMS)
if (!params->data)
return true;
+ /* Don't include ourself */
+ if (strcmp(content->data.html.base_url, params->data) == 0)
+ return true;
+
/* add attributes as parameters to linked list */
for (a = n->properties; a; a = a->next) {
if (strcasecmp((const char *) a->name, "src") == 0)