Bug 1954189 - Unescape the path retrieved from nsIURI before passing it to the Rust hyphenator for loading. r=layout-reviewers,emilio

Differential Revision: https://phabricator.services.mozilla.com/D241685
This commit is contained in:
Jonathan Kew
2025-03-14 22:40:33 +00:00
parent 3860c6675c
commit c3fd842af3

View File

@@ -10,6 +10,7 @@
#include "mozilla/ipc/SharedMemoryHandle.h"
#include "mozilla/ipc/SharedMemoryMapping.h"
#include "nsContentUtils.h"
#include "nsEscape.h"
#include "nsIChannel.h"
#include "nsIFile.h"
#include "nsIFileURL.h"
@@ -274,6 +275,9 @@ nsHyphenator::nsHyphenator(nsIURI* aURI, bool aHyphenateCapitalized)
path.Cut(0, 1);
}
#endif
// In case of %-escaped spaces or other "special" chars in the path,
// we need the unescaped version to pass to mapped_hyph_load_dictionary.
NS_UnescapeURL(path);
if (precompiled) {
// If the file is compiled, we can just map it directly.
UniquePtr<const HyphDic> dic(mapped_hyph_load_dictionary(path.get()));