diff options
-rw-r--r-- | render/box_construct.c | 15 |
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, ¶ms->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) |