Disinfectant Data

I saw various comments everywhere, some say that the zend framework will automatically sanitize messages / data, but others say that it is not.

What a deal? I saw that doing this in pre-cast using foreach on getParams is the fastest way, but does anyone have any suggestions?

+3
source share
3 answers

Probably a deal about Zend_Controller_Requestand Zend_Db. Query data is often placed in the database.

The request object fails. You can force it to do this with filters, form filters, or, for example, using the reflection technique described here:

Zend_Db , ORM, , PDO.

+4

. , , , , . $_GET['foo'] ? .

, ActionHelper .

, .

+4

. - foreach array_map , :

$_POST = array_map('mysql_real_escape_string', $_POST);

Ideally, although you should consider each variable in each case. Personally, I use a lot of PHP filter_varfor filtering and disinfection.

+1
source

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


All Articles