diff options
-rw-r--r-- | activitypub.c | 5 | ||||
-rw-r--r-- | html.c | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/activitypub.c b/activitypub.c index f251811..0b16f7d 100644 --- a/activitypub.c +++ b/activitypub.c @@ -151,7 +151,7 @@ int timeline_request(snac *snac, char **id, xs_str **wrk, int level) { int status = 0; - if (!xs_is_null(*id)) { + if (level < 256 && !xs_is_null(*id)) { xs *msg = NULL; /* is the object already there? */ @@ -206,8 +206,7 @@ int timeline_request(snac *snac, char **id, xs_str **wrk, int level) timeline_add(snac, nid, object); /* recurse! */ - if (level < 32) - timeline_request(snac, &in_reply_to, NULL, level + 1); + timeline_request(snac, &in_reply_to, NULL, level + 1); } } } @@ -839,6 +839,10 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, if (is_hidden(snac, id)) return os; + /* avoid too deep nesting, as it may be a loop */ + if (level >= 256) + return os; + xs *s = xs_str_new("<div>\n"); { |