forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable html() in d3 at the request of security, so that d3 can be us…
…ed in web-facing tools. BUG= NOTRY=true Review URL: https://codereview.chromium.org/216813002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260528 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
andrewhayden@chromium.org
committed
Mar 31, 2014
1 parent
ce0475b
commit 846cc3e
Showing
3 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
diff --git a/third_party/d3/src/d3.js b/third_party/d3/src/d3.js | ||
index a3e4b95..8a98c4d 100644 | ||
--- a/third_party/d3/src/d3.js | ||
+++ b/third_party/d3/src/d3.js | ||
@@ -713,6 +713,7 @@ | ||
}) : this.node().textContent; | ||
}; | ||
d3_selectionPrototype.html = function(value) { | ||
+ throw "disallowed by chromium security"; | ||
return arguments.length ? this.each(typeof value === "function" ? function() { | ||
var v = value.apply(this, arguments); | ||
this.innerHTML = v == null ? "" : v; | ||
@@ -9274,9 +9275,11 @@ | ||
return JSON.parse(request.responseText); | ||
} | ||
d3.html = function(url, callback) { | ||
+ throw "disallowed by chromium security"; | ||
return d3_xhr(url, "text/html", d3_html, callback); | ||
}; | ||
function d3_html(request) { | ||
+ throw "disallowed by chromium security"; | ||
var range = d3_document.createRange(); | ||
range.selectNode(d3_document.body); | ||
return range.createContextualFragment(request.responseText); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters