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:
@@ -10,6 +10,7 @@
|
|||||||
#include "mozilla/ipc/SharedMemoryHandle.h"
|
#include "mozilla/ipc/SharedMemoryHandle.h"
|
||||||
#include "mozilla/ipc/SharedMemoryMapping.h"
|
#include "mozilla/ipc/SharedMemoryMapping.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
|
#include "nsEscape.h"
|
||||||
#include "nsIChannel.h"
|
#include "nsIChannel.h"
|
||||||
#include "nsIFile.h"
|
#include "nsIFile.h"
|
||||||
#include "nsIFileURL.h"
|
#include "nsIFileURL.h"
|
||||||
@@ -274,6 +275,9 @@ nsHyphenator::nsHyphenator(nsIURI* aURI, bool aHyphenateCapitalized)
|
|||||||
path.Cut(0, 1);
|
path.Cut(0, 1);
|
||||||
}
|
}
|
||||||
#endif
|
#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 (precompiled) {
|
||||||
// If the file is compiled, we can just map it directly.
|
// If the file is compiled, we can just map it directly.
|
||||||
UniquePtr<const HyphDic> dic(mapped_hyph_load_dictionary(path.get()));
|
UniquePtr<const HyphDic> dic(mapped_hyph_load_dictionary(path.get()));
|
||||||
|
|||||||
Reference in New Issue
Block a user