Verified Commit 15787e0c authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃 Committed by ma1
Browse files

Bug 1972282 - Check for spoof English in xsl:sort. r=smaug

parent 7581b39d
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -66,6 +66,8 @@ class txXPathNode {
  bool operator!=(const txXPathNode& aNode) const { return !(*this == aNode); }
  ~txXPathNode() { MOZ_COUNT_DTOR(txXPathNode); }

  mozilla::dom::Document* OwnerDoc() const { return mNode->OwnerDoc(); }

 private:
  friend class txXPathNativeNode;
  friend class txXPathNodeUtils;
+7 −0
Original line number Diff line number Diff line
@@ -13,10 +13,13 @@

#include "mozilla/CheckedInt.h"
#include "mozilla/UniquePtrExtensions.h"
#include "nsRFPService.h"

using mozilla::CheckedUint32;
using mozilla::MakeUnique;
using mozilla::MakeUniqueFallible;
using mozilla::nsRFPService;
using mozilla::RFPTarget;
using mozilla::UniquePtr;

/*
@@ -74,6 +77,10 @@ nsresult txNodeSorter::addSortElement(Expr* aSelectExpr, Expr* aLangExpr,
    if (aLangExpr) {
      rv = aLangExpr->evaluateToString(aContext, lang);
      NS_ENSURE_SUCCESS(rv, rv);
    } else if (aContext->getContextNode()
                   .OwnerDoc()
                   ->ShouldResistFingerprinting(RFPTarget::JSLocale)) {
      CopyUTF8toUTF16(nsRFPService::GetSpoofedJSLocale(), lang);
    }

    // Case-order