Skip to content

Commit

Permalink
fix django-cms#7859: allow special characters in page title
Browse files Browse the repository at this point in the history
  • Loading branch information
jrief committed Apr 9, 2024
1 parent c600897 commit 2d8ed15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cms/templatetags/cms_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.encoding import smart_str
from django.utils.html import escape
from django.utils.html import escape, strip_tags
from django.utils.http import urlencode
from django.utils.translation import (
get_language,
Expand Down Expand Up @@ -407,7 +407,9 @@ def get_value(self, context, name, page_lookup):
if page and name in self.valid_attributes:
func = getattr(page, "get_%s" % name)
ret_val = func(language=lang, fallback=True)
if not isinstance(ret_val, datetime):
if name == 'page_title':
ret_val = strip_tags(ret_val)
elif not isinstance(ret_val, datetime):
ret_val = escape(ret_val)
return ret_val
return ''
Expand Down

0 comments on commit 2d8ed15

Please sign in to comment.