mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
Bug 1237546 - Use nsEscapeHTML2 for speech text. r=eitan
This commit is contained in:
parent
c8f39a5d7d
commit
d5fe2ef744
@ -9,6 +9,7 @@
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsWin32Locale.h"
|
||||
#include "GeckoProfiler.h"
|
||||
#include "nsEscape.h"
|
||||
|
||||
#include "mozilla/dom/nsSynthVoiceRegistry.h"
|
||||
#include "mozilla/dom/nsSpeechTask.h"
|
||||
@ -358,7 +359,14 @@ SapiService::Speak(const nsAString& aText, const nsAString& aUri,
|
||||
xml.AppendLiteral("\">");
|
||||
uint32_t textOffset = xml.Length();
|
||||
|
||||
xml.Append(aText);
|
||||
const char16_t* escapedText =
|
||||
nsEscapeHTML2(aText.BeginReading(), aText.Length());
|
||||
if (!escapedText) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
xml.Append(escapedText);
|
||||
free((void*)escapedText);
|
||||
|
||||
xml.AppendLiteral("</pitch>");
|
||||
|
||||
RefPtr<SapiCallback> callback =
|
||||
|
Loading…
Reference in New Issue
Block a user