Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cgocast committed Aug 31, 2023
1 parent c16216b commit 5545873
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/running_psalm/issues/TaintedXpath.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TaintedSql
# TaintedXpath

Emitted when user-controlled input can be passed into to a xpath query.

Expand Down
8 changes: 4 additions & 4 deletions tests/TaintTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ function bar(array $arr): void {
$d = mysqli_real_escape_string($_GET["d"]);
$mysqli->query("$a$b$c$d");',
],
],
'querySimpleXMLElement' => [
'code' => '<?php
/**
Expand Down Expand Up @@ -2521,23 +2521,23 @@ public static function getPrevious(string $s): string {
function queryExpression(SimpleXMLElement $xml) : array|false|null {
$expression = $_GET["expression"];
return $xml->xpath($expression);
}',
}',
'error_message' => 'TaintedXpath',
],
'queryDOMXPath' => [
'code' => '<?php
function queryExpression(DOMXPath $xpath) : mixed {
$expression = $_GET["expression"];
return $xpath->query($expression);
}',
}',
'error_message' => 'TaintedXpath',
],
'evaluateDOMXPath' => [
'code' => '<?php
function evaluateExpression(DOMXPath $xpath) : mixed {
$expression = $_GET["expression"];
return $xpath->evaluate($expression);
}',
}',
'error_message' => 'TaintedXpath',
],
];
Expand Down

0 comments on commit 5545873

Please sign in to comment.