Browse Source

Added escaped page source in Meta page

master
Dirk Alders 1 month ago
parent
commit
584d3d7eb9
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      pages/models.py

+ 2
- 1
pages/models.py View File

1
 from django.conf import settings
1
 from django.conf import settings
2
 from django.contrib.auth.models import User, Group
2
 from django.contrib.auth.models import User, Group
3
 from django.db import models
3
 from django.db import models
4
+from django.utils.html import escape
4
 from django.utils.translation import gettext as _
5
 from django.utils.translation import gettext as _
5
 from simple_history.models import HistoricalRecords
6
 from simple_history.models import HistoricalRecords
6
 
7
 
160
         else:
161
         else:
161
             appendix = "<h1>" + _("Page source") + "</h1>\n"
162
             appendix = "<h1>" + _("Page source") + "</h1>\n"
162
             appendix += "<pre>\n"
163
             appendix += "<pre>\n"
163
-            appendix += self.page_txt
164
+            appendix += escape(self.page_txt)
164
             appendix += "</pre>\n"
165
             appendix += "</pre>\n"
165
 
166
 
166
         #
167
         #

Loading…
Cancel
Save