summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-07-06 15:41:06 -0400
committerTim Graham <timograham@gmail.com>2016-07-18 11:17:01 -0400
commit93c538694e6b14a29cb0f52b784a3bfed604fda6 (patch)
treef075545736aec4ea866a60313eae2eae45349ec8 /django
parent767849b765e881ee905f2bc1175d1c1f47445554 (diff)
Fixed XSS in admin's add/change related popup.
This is a security fix.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js2
-rw-r--r--django/views/debug.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js b/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js
index 0f02051e6b..d2dda892b1 100644
--- a/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js
+++ b/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js
@@ -104,7 +104,7 @@
var selects = $(selectsSelector);
selects.find('option').each(function() {
if (this.value === objId) {
- this.innerHTML = newRepr;
+ this.textContent = newRepr;
this.value = newId;
}
});
diff --git a/django/views/debug.py b/django/views/debug.py
index 56329325d3..eac0a77605 100644
--- a/django/views/debug.py
+++ b/django/views/debug.py
@@ -636,13 +636,13 @@ TECHNICAL_500_TEMPLATE = ("""
var s = link.getElementsByTagName('span')[0];
var uarr = String.fromCharCode(0x25b6);
var darr = String.fromCharCode(0x25bc);
- s.innerHTML = s.innerHTML == uarr ? darr : uarr;
+ s.textContent = s.textContent == uarr ? darr : uarr;
return false;
}
function switchPastebinFriendly(link) {
s1 = "Switch to copy-and-paste view";
s2 = "Switch back to interactive view";
- link.innerHTML = link.innerHTML.trim() == s1 ? s2: s1;
+ link.textContent = link.textContent.trim() == s1 ? s2: s1;
toggle('browserTraceback', 'pastebinTraceback');
return false;
}