From abfeb20059c6f9d4cdc8f966949630a14a9835d2 Mon Sep 17 00:00:00 2001 From: Morten Engelhardt Olsen Date: Wed, 28 May 2025 09:27:02 -0700 Subject: [PATCH] Do not validate for http:// URLs in elements and attributes that are definitiely part of a different namespace Since the XML parser does not seem to have much support at all for namespaces, this fix is very ... raw in that it only looks for a namespace delimintor `:` and if we find that in a element, mark it as ok. If we find it in an attribute, do not check it. This fixes #2093 Make the test namespace generic --- tools/packchk/src/CheckFiles.cpp | 4 ++++ .../test/data/TestUrlHttps/TestVendor.TestUrlHttps.pdsc | 7 +++++++ tools/packchk/test/integtests/src/PackChkIntegTests.cpp | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/packchk/src/CheckFiles.cpp b/tools/packchk/src/CheckFiles.cpp index 2d6e2fa71..4c188bd45 100644 --- a/tools/packchk/src/CheckFiles.cpp +++ b/tools/packchk/src/CheckFiles.cpp @@ -40,6 +40,10 @@ CheckFilesVisitor::~CheckFilesVisitor() */ VISIT_RESULT CheckFilesVisitor::Visit(RteItem* item) { + const string& tag = item->GetTag(); + if(tag == "environment") { + return VISIT_RESULT::SKIP_CHILDREN; + } m_checkFiles.CheckFile(item); m_checkFiles.CheckUrls(item); m_checkFiles.CheckDeprecated(item); diff --git a/tools/packchk/test/data/TestUrlHttps/TestVendor.TestUrlHttps.pdsc b/tools/packchk/test/data/TestUrlHttps/TestVendor.TestUrlHttps.pdsc index d18d4ec78..6d16d0484 100644 --- a/tools/packchk/test/data/TestUrlHttps/TestVendor.TestUrlHttps.pdsc +++ b/tools/packchk/test/data/TestUrlHttps/TestVendor.TestUrlHttps.pdsc @@ -47,6 +47,13 @@ + + + + + diff --git a/tools/packchk/test/integtests/src/PackChkIntegTests.cpp b/tools/packchk/test/integtests/src/PackChkIntegTests.cpp index 60f34e152..5ef4fa976 100644 --- a/tools/packchk/test/integtests/src/PackChkIntegTests.cpp +++ b/tools/packchk/test/integtests/src/PackChkIntegTests.cpp @@ -806,7 +806,7 @@ TEST_F(PackChkIntegTests, CheckUrlForHttp) { } if (M300_foundCnt != 8) { - FAIL() << "error: missing message M300"; + FAIL() << "error: missing number of M300, found " << M300_foundCnt; } }