Bug 1966027 - Document.parseHTMLUnsafe shouldn't sanitize as safe. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D249035
This commit is contained in:
committed by
tschuster@mozilla.com
parent
49b12c4176
commit
aceb72f7f9
@@ -20332,13 +20332,13 @@ already_AddRefed<Document> Document::ParseHTMLUnsafe(
|
|||||||
nsCOMPtr<nsIGlobalObject> global =
|
nsCOMPtr<nsIGlobalObject> global =
|
||||||
do_QueryInterface(aGlobal.GetAsSupports());
|
do_QueryInterface(aGlobal.GetAsSupports());
|
||||||
RefPtr<Sanitizer> sanitizer = Sanitizer::GetInstance(
|
RefPtr<Sanitizer> sanitizer = Sanitizer::GetInstance(
|
||||||
global, aOptions.mSanitizer.Value(), true, aError);
|
global, aOptions.mSanitizer.Value(), /* aSafe */ false, aError);
|
||||||
if (aError.Failed()) {
|
if (aError.Failed()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 6. Call sanitize on document with sanitizer and false.
|
// Step 6. Call sanitize on document with sanitizer and false.
|
||||||
sanitizer->Sanitize(doc, /* aSafe */ true, aError);
|
sanitizer->Sanitize(doc, /* aSafe */ false, aError);
|
||||||
if (aError.Failed()) {
|
if (aError.Failed()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -20375,7 +20375,7 @@ already_AddRefed<Document> Document::ParseHTML(GlobalObject& aGlobal,
|
|||||||
// from options with options and true.
|
// from options with options and true.
|
||||||
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
|
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
|
||||||
RefPtr<Sanitizer> sanitizer =
|
RefPtr<Sanitizer> sanitizer =
|
||||||
Sanitizer::GetInstance(global, aOptions.mSanitizer, true, aError);
|
Sanitizer::GetInstance(global, aOptions.mSanitizer, /* aSafe */ true, aError);
|
||||||
if (aError.Failed()) {
|
if (aError.Failed()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user