Skip to content

Commit 3945b35

Browse files
committed
AC-3483:: SVC false-positive: modifying system.xml file from another module
1 parent c8c6b17 commit 3945b35

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Analyzer/SystemXml/Analyzer.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,21 @@ public function analyze($registryBefore, $registryAfter)
121121
private function reportAddedNodesWithDuplicateCheck($afterFile, $addedNodes, $moduleNodesBefore)
122122
{
123123
print_r('Report Added Nodes function called.');
124+
$isDuplicate = false;
125+
124126
foreach ($addedNodes as $nodeId => $node) {
125127
$this->inspectObject($node);
128+
126129
// Check for duplicates by comparing node content except for 'id'
127-
$isDuplicate = false;
128130
foreach ($moduleNodesBefore as $existingNodeId => $existingNode) {
129131
if ($this->isDuplicateNode($node, $existingNode)) {
130132
$isDuplicate = true;
131-
break;
133+
break 2; // Break out of both loops if a duplicate is found
132134
}
133135
}
134-
return $isDuplicate;
135136
}
137+
138+
return $isDuplicate;
136139
}
137140

138141
private function inspectObject($object)

0 commit comments

Comments
 (0)