1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

Change taint path names to prepare for allowing array key tainting

This commit is contained in:
Matt Brown 2021-03-24 15:23:56 -04:00
parent 9ad88256d1
commit 937e68cc75
5 changed files with 9 additions and 9 deletions

View File

@ -264,7 +264,7 @@ class ArrayAnalyzer
$data_flow_graph->addPath(
$parent_node,
$new_parent_node,
'array-assignment'
'arrayvalue-assignment'
);
}
@ -379,7 +379,7 @@ class ArrayAnalyzer
$data_flow_graph->addPath(
$parent_node,
$new_parent_node,
'array-assignment'
'arrayvalue-assignment'
. ($item_key_value !== null ? '-\'' . $item_key_value . '\'' : ''),
$added_taints,
$removed_taints

View File

@ -405,14 +405,14 @@ class ArrayAssignmentAnalyzer
$statements_analyzer->data_flow_graph->addPath(
$child_parent_node,
$parent_node,
'array-assignment-\'' . $key_value->value . '\''
'arrayvalue-assignment-\'' . $key_value->value . '\''
);
}
} else {
$statements_analyzer->data_flow_graph->addPath(
$child_parent_node,
$parent_node,
'array-assignment'
'arrayvalue-assignment'
);
}
}

View File

@ -365,7 +365,7 @@ class ArrayFetchAnalyzer
$var_location = new CodeLocation($statements_analyzer->getSource(), $var);
$new_parent_node = DataFlowNode::getForAssignment(
$keyed_array_var_id ?: 'array-fetch',
$keyed_array_var_id ?: 'arrayvalue-fetch',
$var_location
);
@ -381,7 +381,7 @@ class ArrayFetchAnalyzer
$statements_analyzer->data_flow_graph->addPath(
$parent_node,
$new_parent_node,
'array-fetch' . ($dim_value !== null ? '-\'' . $dim_value . '\'' : ''),
'arrayvalue-fetch' . ($dim_value !== null ? '-\'' . $dim_value . '\'' : ''),
$added_taints,
$removed_taints
);
@ -390,7 +390,7 @@ class ArrayFetchAnalyzer
$statements_analyzer->data_flow_graph->addPath(
$new_parent_node,
$parent_node,
'array-assignment' . ($dim_value !== null ? '-\'' . $dim_value . '\'' : ''),
'arrayvalue-assignment' . ($dim_value !== null ? '-\'' . $dim_value . '\'' : ''),
$added_taints,
$removed_taints
);

View File

@ -260,7 +260,7 @@ class TaintFlowGraph extends DataFlowGraph
continue;
}
if (self::shouldIgnoreFetch($path_type, 'array', $generated_source->path_types)) {
if (self::shouldIgnoreFetch($path_type, 'arrayvalue', $generated_source->path_types)) {
continue;
}

View File

@ -163,7 +163,7 @@ class VariableUseGraph extends DataFlowGraph
continue;
}
if (self::shouldIgnoreFetch($path_type, 'array', $generated_source->path_types)) {
if (self::shouldIgnoreFetch($path_type, 'arrayvalue', $generated_source->path_types)) {
continue;
}