Skip to content

Commit 4cc887a

Browse files
author
Agus Makmun
committed
fix: XSS using javascript: URLs #167
1 parent 76872a6 commit 4cc887a

File tree

12 files changed

+47
-23
lines changed

12 files changed

+47
-23
lines changed

martor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
22

3-
__VERSION__ = '1.6.7'
3+
__VERSION__ = '1.6.8'
44
__AUTHOR__ = 'Agus Makmun (Summon Agus)'
55
__AUTHOR_EMAIL__ = '[email protected]'

martor/settings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,9 @@
106106
MARTOR_ALTERNATIVE_JQUERY_JS_FILE = getattr(
107107
settings, 'MARTOR_ALTERNATIVE_JQUERY_JS_FILE', None
108108
)
109+
110+
ALLOWED_URL_SCHEMES = getattr(
111+
settings, 'ALLOWED_URL_SCHEMES',
112+
['file', 'ftp', 'ftps', 'http', 'https', 'irc', 'mailto',
113+
'sftp', 'ssh', 'tel', 'telnet', 'tftp', 'vnc', 'xmpp']
114+
)

martor/static/martor/css/martor-admin.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/static/martor/css/martor.bootstrap.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/static/martor/css/martor.semantic.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/static/martor/js/martor.bootstrap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* Name : Martor v1.6.7
2+
* Name : Martor v1.6.8
33
* Created by : Agus Makmun (Summon Agus)
4-
* Release date : 19-Dec-2021
4+
* Release date : 21-Dec-2021
55
* License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
66
* Repository : https://github.com/agusmakmun/django-markdown-editor
77
**/

martor/static/martor/js/martor.bootstrap.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/static/martor/js/martor.semantic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* Name : Martor v1.6.7
2+
* Name : Martor v1.6.8
33
* Created by : Agus Makmun (Summon Agus)
4-
* Release date : 19-Dec-2021
4+
* Release date : 21-Dec-2021
55
* License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
66
* Repository : https://github.com/agusmakmun/django-markdown-editor
77
**/

martor/static/martor/js/martor.semantic.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/templatetags/martortags.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88

99
@register.filter
10-
def safe_markdown(field_name):
10+
def safe_markdown(markdown_text):
1111
"""
1212
Safe the markdown text as html ouput.
1313
1414
Usage:
1515
{% load martortags %}
16-
{{ field_name|safe_markdown }}
16+
{{ markdown_text|safe_markdown }}
1717
1818
Example:
1919
{{ post.description|safe_markdown }}
2020
"""
21-
return mark_safe(markdownify(field_name))
21+
return mark_safe(markdownify(markdown_text))

0 commit comments

Comments
 (0)