note 119855 deleted from security.globals by cmb
| From: | cmb@php.net | Date: | Sun, 17 Jan 2021 13:56:47 +0000 |
| Subject: | note 119855 deleted from security.globals by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-216176@lists.php.net to get a copy of this message | ||
Note Submitter: steve at dbnsystems dot com
----
The following version could be even faster, unless anyone may come with a good reason why this
wouldn't be a good practice:
<pre>
function unregister_globals() {
if (ini_get(register_globals)) {
$array = array('_REQUEST', '_SESSION', '_SERVER',
'_ENV', '_FILES');
foreach ($array as $value) {
$$value = [];
}
}
}
</pre>