From 29fdc774a922b499e6e4ba5ddb54826095136ab3 Mon Sep 17 00:00:00 2001 From: TLSM Date: Mon, 30 May 2022 06:58:42 -0400 Subject: [PATCH] Feeds: make valid, part deux. Continuation of 5d6d4f9ca076. Again, h/t to our friends at WPD for providing a patch. --- files/routes/feeds.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/routes/feeds.py b/files/routes/feeds.py index a64a2827f..2123302ba 100644 --- a/files/routes/feeds.py +++ b/files/routes/feeds.py @@ -42,7 +42,7 @@ def feeds_user(sort='hot', t='all'): for post in posts: with tag("entry", ("xml:base", SITE_FULL + request.full_path)): - with tag("title", type="text"): + with tag("title", type="html"): text(post.realtitle(None)) with tag("id"): @@ -51,6 +51,8 @@ def feeds_user(sort='hot', t='all'): if (post.edited_utc): with tag("updated"): text(datetime.utcfromtimestamp(post.edited_utc).isoformat()+"Z") + else: + text(datetime.utcfromtimestamp(post.created_utc).isoformat()+"Z") with tag("published"): text(datetime.utcfromtimestamp(post.created_utc).isoformat()+"Z") @@ -69,6 +71,6 @@ def feeds_user(sort='hot', t='all'): if len(post.body_html): with tag("content", type="html"): - doc.cdata(f'''{post.realtitle(None)}
{post.realbody(None)}''') + doc.cdata(f'''{post.realtitle(None)}
{post.realbody(None)}''') return Response( ""+ doc.getvalue(), mimetype="application/xml")