2 ms·
The problem is when unexpected variables are overwritten. It would be better to have a mandatory list of allowed variables that can be extracted. $login =
by zimbatm 12y ago
The problem is when unexpected variables are overwritten. It would be better to have a mandatory list of allowed variables that can be extracted.
$login = '1234';
extract(array('login'=>true, 'messsage'=>'hacker'), 'message');
var_dump($login_, $message);
// => $login='1234', $message='hacker'
(pardon my rusty PHP)
- ars 12y ago> variables are overwritten. It would be better to have a mandatory list of allowed variables that can be extracted. You can set the EXTR_SKIP flag to do something like that. There are a bunch of other flags as well to control how it works.