5cpdo 3a 3aattr emulate prepares 3d 3e true security issue

Solutions on MaxInterview for 5cpdo 3a 3aattr emulate prepares 3d 3e true security issue by the best coders in the world

showing results for - " 5cpdo 3a 3aattr emulate prepares 3d 3e true security issue"
Charlene
30 Jul 2018
1 The option
2
3'options'   => [
4                \PDO::ATTR_EMULATE_PREPARES => true
5            ]
6will resolve the issue, However, beside the security issues it generates, it also effect all select queries that you perform on the DB in the way that it force/convert every returned type from the DB to be string instead of the real type (integer/ float)
7
8How does it effect you?
9
10if you have a validation layer above the result of the query, you can't perform something like (
11
12if (is_int($model->id))
13) which will return 0 always, because it's string not an integer anymore.