You are here

function CoderSecurityTest::testSecurityPostGetRequest in Coder 6.2

File

tests/coder_security.test, line 222

Class

CoderSecurityTest

Code

function testSecurityPostGetRequest() {
  $this
    ->assertCoderPass('  $_POST["safe_data"] = "abc";');
  $this
    ->assertCoderPass('  $_POST["tainted_data"] .= "abc";');
  $this
    ->assertCoderPass('  $post = check_plain($_POST["tainted_data"]);');
  $this
    ->assertCoderPass('  $post = check_markup($_POST["tainted_data"]);');
  $this
    ->assertCoderPass('  $post = filter_xss($_POST["tainted_data"]);');
  $this
    ->assertCoderPass('  $post = filter_xss_admin($_POST["tainted_data"]);');
  $this
    ->assertCoderPass('  $post = form_set_cache($_POST["form_build_id"], $form_state);');
  $this
    ->assertCoderFail('  $post = $_POST["tainted_data"];');
  $this
    ->assertCoderFail('  t($_POST["tainted_data"]);');
}