You are here

public function ConditionTest::providerTestCompileWithSqlInjectionForOperator in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Database/ConditionTest.php \Drupal\Tests\Core\Database\ConditionTest::providerTestCompileWithSqlInjectionForOperator()

File

core/tests/Drupal/Tests/Core/Database/ConditionTest.php, line 158
Contains \Drupal\Tests\Core\Database\ConditionTest.

Class

ConditionTest
@coversDefaultClass \Drupal\Core\Database\Query\Condition

Namespace

Drupal\Tests\Core\Database

Code

public function providerTestCompileWithSqlInjectionForOperator() {
  $data = [];
  $data[] = [
    "IS NOT NULL) ;INSERT INTO {test} (name) VALUES ('test12345678'); -- ",
  ];
  $data[] = [
    "IS NOT NULL) UNION ALL SELECT name, pass FROM {users_field_data} -- ",
  ];
  $data[] = [
    "IS NOT NULL) UNION ALL SELECT name FROM {TEST_UPPERCASE} -- ",
  ];
  $data[] = [
    "= 1 UNION ALL SELECT password FROM user WHERE uid =",
  ];
  return $data;
}