Skip to content

Commit abe1de2

Browse files
committed
fix #16 CustomAnalysis
1 parent b69cb7b commit abe1de2

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

package/src/progpilot/Analysis/CustomAnalysis.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -240,17 +240,19 @@ public static function mustVerifyDefinition($context, $instruction, $myFunc, $st
240240
$hashedValue = $myFunc->getLine();
241241
$hashedValue.= "-".$customRule->getAction()."-".$myFunc->getSourceMyFile()->getName();
242242
$idVuln = hash("sha256", $hashedValue);
243-
244-
$temp["vuln_rule"] = Utils::encodeCharacters($customRule->getAction());
245-
$temp["vuln_name"] = Utils::encodeCharacters($customRule->getAttack());
246-
$temp["vuln_line"] = $myFunc->getLine();
247-
$temp["vuln_column"] = $myFunc->getColumn();
248-
$temp["vuln_file"] = Utils::encodeCharacters($myFunc->getSourceMyFile()->getName());
249-
$temp["vuln_description"] = Utils::encodeCharacters($customRule->getDescription());
250-
$temp["vuln_cwe"] = Utils::encodeCharacters($customRule->getCwe());
251-
$temp["vuln_id"] = $idVuln;
252-
$temp["vuln_type"] = "custom";
253-
$context->outputs->addResult($temp);
243+
244+
if(is_null($context->inputs->getFalsePositiveById($idVuln))) {
245+
$temp["vuln_rule"] = Utils::encodeCharacters($customRule->getAction());
246+
$temp["vuln_name"] = Utils::encodeCharacters($customRule->getAttack());
247+
$temp["vuln_line"] = $myFunc->getLine();
248+
$temp["vuln_column"] = $myFunc->getColumn();
249+
$temp["vuln_file"] = Utils::encodeCharacters($myFunc->getSourceMyFile()->getName());
250+
$temp["vuln_description"] = Utils::encodeCharacters($customRule->getDescription());
251+
$temp["vuln_cwe"] = Utils::encodeCharacters($customRule->getCwe());
252+
$temp["vuln_id"] = $idVuln;
253+
$temp["vuln_type"] = "custom";
254+
$context->outputs->addResult($temp);
255+
}
254256
}
255257
}
256258
}

0 commit comments

Comments
 (0)