Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Unified Diff: Source/core/dom/Document.cpp

Issue 22911020: Block "]]>" in createCDataSection (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added trailing whitespace to "expected". Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/dom/Document/createCDATASection-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 9dfe1b6aff51b606a7eef0ba47b3a8d2309763d5..06fc17552b892b38b1e884123c5e740b08181cdb 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -806,6 +806,10 @@ PassRefPtr<CDATASection> Document::createCDATASection(const String& data, Except
es.throwDOMException(NotSupportedError);
return 0;
}
+ if (data.find("]]>") != WTF::notFound) {
+ es.throwDOMException(InvalidCharacterError, "String cannot contain ']]>' since that is the end delimiter of a CData section.");
+ return 0;
+ }
return CDATASection::create(this, data);
}
« no previous file with comments | « LayoutTests/fast/dom/Document/createCDATASection-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698