From 6496599e9090349362cc285207cfcc94d71a22af Mon Sep 17 00:00:00 2001 From: dorian-adams Date: Fri, 13 Oct 2023 02:19:02 -0400 Subject: [PATCH 1/2] Fix HTML leak in job_detail Use `striptags` to strip all html from `og:description`, which was causing HTML to leak. Resolves #2307 --- templates/jobs/job_detail.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/jobs/job_detail.html b/templates/jobs/job_detail.html index be073e551..12c204aba 100644 --- a/templates/jobs/job_detail.html +++ b/templates/jobs/job_detail.html @@ -8,7 +8,7 @@ {% block content_attributes %}with-right-sidebar{% endblock %} {% block og_title %}Job: {{ object.job_title }} at {{ object.company_name }}{% endblock %} -{% block og-descript %}{{ object.description|escape|truncatechars:200 }}{% endblock %} +{% block og-descript %}{{ object.description|striptags|truncatechars:200 }}{% endblock %} {% block content %} {% load companies %} From f4f05890088febd51de1ed5503048d41f160a3fa Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Thu, 27 Nov 2025 09:35:22 -0600 Subject: [PATCH 2/2] Update templates/jobs/job_detail.html Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- templates/jobs/job_detail.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/jobs/job_detail.html b/templates/jobs/job_detail.html index 12c204aba..cef7c1f2f 100644 --- a/templates/jobs/job_detail.html +++ b/templates/jobs/job_detail.html @@ -8,7 +8,7 @@ {% block content_attributes %}with-right-sidebar{% endblock %} {% block og_title %}Job: {{ object.job_title }} at {{ object.company_name }}{% endblock %} -{% block og-descript %}{{ object.description|striptags|truncatechars:200 }}{% endblock %} +{% block og-descript %}{{ object.description.rendered|striptags|truncatechars:200 }}{% endblock %} {% block content %} {% load companies %}