Exemplo n.º 1
0
        $stmt->execute();
        $stmt->bind_result($name, $comment);
        $numRows = 0;
        while ($stmt->fetch()) {
            $numRows = $numRows + 1;
            if ($name != "MrT") {
                echo "Test Prevent Injection 3 = Failure<br />";
                return;
            }
            if ($comment != "\"I pity the foo()\"") {
                echo "Test Prevent Injection 3 = Failure<br />";
                return;
            }
        }
        if ($numRows == 1) {
            echo "Test Prevent Injection 3 = Success<br />";
        } else {
            echo "Test Prevent Injection 3 = Failure<br />";
        }
    }
}
$tests = new TestSuite();
$tests->testAddComment();
$tests->testContentFilter();
$tests->testContentFilter2();
$tests->testContentFilter3();
$tests->testSQLInjection();
$tests->testSQLInjection2();
$tests->testSQLInjection3();
?>