-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
ACK_WAITINGissue to be reviewed and confirmedissue to be reviewed and confirmedUPDATE_TPissue is about updating a testability patternissue is about updating a testability pattern
Description
Testability pattern
Problem statement
The php code for instance 2 and instance 3 is the same.
<?php
$a = "ttt";
$b = $_GET["p1"];
$c = $_GET["p2"];
$x = array(1,2,$a=>$b);
echo $x[$c];Proposed changes
One possiblity for changing the code of instance 3 I came up with, was this:
<?php
$b = $_GET["p1"];
$c = $_GET["p2"]; // source
$x = array(1,2,$b=>$c);
echo $x[$b]; // sinkThe key and the value in x are now user controlled.
This is of course only one possibility.
Other
Do you have any other ideas? Or is it more useful to delete that instance?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ACK_WAITINGissue to be reviewed and confirmedissue to be reviewed and confirmedUPDATE_TPissue is about updating a testability patternissue is about updating a testability pattern