logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 0f67eab38483c574db82a00b53fb29e13c7df089
parent f597b1b3e6f04125422c0f7d8e076be44e578e48
Author: faried nawaz <faried@gmail.com>
Date:   Tue, 15 Nov 2022 23:42:54 +0500

remove pub_date() -- use to_rfc2822 instead

_tag_activity.xml.eex used activity_content() instead
of activity_description(), and did not escape html properly.

Diffstat:

Mlib/pleroma/web/feed/feed_view.ex9---------
Mlib/pleroma/web/templates/feed/feed/_tag_activity.xml.eex4++--
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 @@ -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 @@ -4,9 +4,9 @@ <guid isPermalink="true"><%= activity_context(@activity) %></guid> <link><%= activity_context(@activity) %></link> - <pubDate><%= pub_date(@activity.data["published"]) %></pubDate> + <pubDate><%= to_rfc2822(@activity.data["published"]) %></pubDate> - <description><%= activity_content(@data) %></description> + <description><%= activity_description(@data) %></description> <%= for attachment <- @data["attachment"] || [] do %> <enclosure url="<%= attachment_href(attachment) %>" type="<%= attachment_type(attachment) %>"/> <% end %>