icecat: add release icecat-140.10.1-1gnu1 for ecne
This commit is contained in:
parent
a5f93cb214
commit
ff85d7c623
1256 changed files with 63469 additions and 24141 deletions
|
|
@ -12,11 +12,28 @@
|
|||
namespace mozilla::dom {
|
||||
|
||||
/* static */
|
||||
bool FileSystemUtils::IsDescendantPath(const nsAString& aPath,
|
||||
const nsAString& aDescendantPath) {
|
||||
bool FileSystemUtils::IsDescendantPath(const nsAString& aAuthorizedRoot,
|
||||
const nsAString& aRequestedDescendant) {
|
||||
// Check the sub-directory path to see if it has the parent path as prefix.
|
||||
if (!aDescendantPath.Equals(aPath) &&
|
||||
!StringBeginsWith(aDescendantPath, aPath)) {
|
||||
if (aRequestedDescendant.Equals(aAuthorizedRoot)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!StringBeginsWith(/*aSource*/ aRequestedDescendant,
|
||||
/*aSubstring*/ aAuthorizedRoot)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Require a path separator immediately after the granted prefix.
|
||||
const uint32_t prefixLen = aAuthorizedRoot.Length();
|
||||
if (prefixLen > 0 &&
|
||||
aAuthorizedRoot.Last() == FILESYSTEM_DOM_PATH_SEPARATOR_CHAR) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (aRequestedDescendant.Length() <= prefixLen ||
|
||||
aRequestedDescendant.CharAt(prefixLen) !=
|
||||
FILESYSTEM_DOM_PATH_SEPARATOR_CHAR) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue