Skip to content

Commit f1e5df6

Browse files
xoriathedriouk
andauthored
Do not validate for http:// URLs in elements and attributes that are … (#2094)
…definitely 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 delimiter `:` and if we find that in an element, mark it as ok. If we find it in an attribute, do not check it. This fixes #2093 Co-authored-by: Evgueni Driouk <[email protected]>
1 parent 630fd22 commit f1e5df6

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

tools/packchk/src/CheckFiles.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ CheckFilesVisitor::~CheckFilesVisitor()
4040
*/
4141
VISIT_RESULT CheckFilesVisitor::Visit(RteItem* item)
4242
{
43+
const string& tag = item->GetTag();
44+
if(tag == "environment") {
45+
return VISIT_RESULT::SKIP_CHILDREN;
46+
}
4347
m_checkFiles.CheckFile(item);
4448
m_checkFiles.CheckUrls(item);
4549
m_checkFiles.CheckDeprecated(item);

tools/packchk/test/data/TestUrlHttps/TestVendor.TestUrlHttps.pdsc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@
4747
<subFamily DsubFamily="MyDevice">
4848
<device Dname="MyDeviceM0">
4949
<processor Dfpu="0" Dmpu="0" Dendian="Little-endian" Dclock="24000000"/>
50+
<environment name="test_env">
51+
<e:extension xmlns:e="http://example.com"
52+
schemaVersion="1.0"
53+
xsi:schemaLocation="http://example.com example.xsd">
54+
<e:element value="test"/>
55+
</e:extension>
56+
</environment>
5057
</device>
5158
</subFamily>
5259
</family>

tools/packchk/test/integtests/src/PackChkIntegTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ TEST_F(PackChkIntegTests, CheckUrlForHttp) {
806806
}
807807

808808
if (M300_foundCnt != 8) {
809-
FAIL() << "error: missing message M300";
809+
FAIL() << "error: missing number of M300, found " << M300_foundCnt;
810810
}
811811
}
812812

0 commit comments

Comments
 (0)