From 0f67eab38483c574db82a00b53fb29e13c7df089 Mon Sep 17 00:00:00 2001 From: faried nawaz Date: Tue, 15 Nov 2022 23:42:54 +0500 Subject: [PATCH] remove pub_date() -- use to_rfc2822 instead _tag_activity.xml.eex used activity_content() instead of activity_description(), and did not escape html properly. --- lib/pleroma/web/feed/feed_view.ex | 9 --------- .../web/templates/feed/feed/_tag_activity.xml.eex | 4 ++-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/pleroma/web/feed/feed_view.ex b/lib/pleroma/web/feed/feed_view.ex index 3e24397aa..449659f4b 100644 --- a/lib/pleroma/web/feed/feed_view.ex +++ b/lib/pleroma/web/feed/feed_view.ex @@ -17,15 +17,6 @@ defmodule Pleroma.Web.Feed.FeedView do @days ~w(Mon Tue Wed Thu Fri Sat Sun) @months ~w(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec) - @spec pub_date(String.t() | DateTime.t()) :: String.t() - def pub_date(date) when is_binary(date) do - date - |> Timex.parse!("{ISO:Extended}") - |> pub_date - end - - def pub_date(%DateTime{} = date), do: to_rfc2822(date) - def prepare_activity(activity, opts \\ []) do object = Object.normalize(activity, fetch: false) diff --git a/lib/pleroma/web/templates/feed/feed/_tag_activity.xml.eex b/lib/pleroma/web/templates/feed/feed/_tag_activity.xml.eex index 2334e24a2..d582c83e8 100644 --- a/lib/pleroma/web/templates/feed/feed/_tag_activity.xml.eex +++ b/lib/pleroma/web/templates/feed/feed/_tag_activity.xml.eex @@ -4,9 +4,9 @@ <%= activity_context(@activity) %> <%= activity_context(@activity) %> - <%= pub_date(@activity.data["published"]) %> + <%= to_rfc2822(@activity.data["published"]) %> - <%= activity_content(@data) %> + <%= activity_description(@data) %> <%= for attachment <- @data["attachment"] || [] do %> <% end %>