Doctrine and SQL Injection

Does Doctrine Prevent Auto SQL Injection? Is the following code safe?

$user = new Model_User();
$user->name = $_POST['username'];
$user->save();
+3
source share
2 answers

Regarding SQL injection, I think there will be no problems. But you can also make sure that the username is well-formed (maybe, for example, <script>//do somthing bad</script>and that the script will be executed, for example, when this username is displayed on the site)

+4
source

SQL- Doctrine ( PDO), ( Doctrine , ), , . PHP Filter, . , , FILTER_SANITIZE_STRING "-, ".

+3

Source: https://habr.com/ru/post/1781638/


All Articles