mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1883804 - Only unescape ASCII chars in IDTracker::ResetWithLocalRef. r=longsonr
Differential Revision: https://phabricator.services.mozilla.com/D205039
This commit is contained in:
parent
7e42f22388
commit
38685b833f
@ -143,8 +143,19 @@ void IDTracker::ResetWithLocalRef(Element& aFrom, const nsAString& aLocalRef,
|
||||
Unlink();
|
||||
return;
|
||||
}
|
||||
NS_UnescapeURL(utf8Ref);
|
||||
RefPtr<nsAtom> idAtom = NS_Atomize(utf8Ref);
|
||||
|
||||
// Only unescape ASCII characters; if we were to unescape arbitrary bytes,
|
||||
// we'd potentially end up with invalid UTF-8.
|
||||
nsAutoCString unescaped;
|
||||
bool appended;
|
||||
if (NS_FAILED(NS_UnescapeURL(utf8Ref.BeginReading(), utf8Ref.Length(),
|
||||
esc_OnlyASCII | esc_AlwaysCopy, unescaped,
|
||||
appended, mozilla::fallible))) {
|
||||
Unlink();
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<nsAtom> idAtom = NS_Atomize(unescaped);
|
||||
ResetWithID(aFrom, idAtom, aWatch);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,3 @@
|
||||
<svg>
|
||||
<set xlink:href="#)᭭%a8*=٫́壎
|
||||
<title class="
>
|
After Width: | Height: | Size: 67 B |
Loading…
Reference in New Issue
Block a user