function ConditionTest::providerTestCompileWithSqlInjectionForOperator

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Database/ConditionTest.php \Drupal\Tests\Core\Database\ConditionTest::providerTestCompileWithSqlInjectionForOperator()
  2. 8.9.x core/tests/Drupal/Tests/Core/Database/ConditionTest.php \Drupal\Tests\Core\Database\ConditionTest::providerTestCompileWithSqlInjectionForOperator()
  3. 10 core/tests/Drupal/Tests/Core/Database/ConditionTest.php \Drupal\Tests\Core\Database\ConditionTest::providerTestCompileWithSqlInjectionForOperator()

File

core/tests/Drupal/Tests/Core/Database/ConditionTest.php, line 178

Class

ConditionTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Database%21Query%21Condition.php/class/Condition/11.x" title="Generic class for a series of conditions in a query." class="local">\Drupal\Core\Database\Query\Condition</a>

Namespace

Drupal\Tests\Core\Database

Code

public static 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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.