Include new "full_path" field in security hash as of PHP 8.1

This commit is contained in:
Markus Bauer 2022-10-07 15:17:21 +02:00 committed by Kamil Wylegala
parent ef8fee29b2
commit a139699e7e

View file

@ -1803,6 +1803,9 @@ class FormHelper extends AppHelper {
foreach (array('name', 'type', 'tmp_name', 'error', 'size') as $suffix) { foreach (array('name', 'type', 'tmp_name', 'error', 'size') as $suffix) {
$this->_secure($secure, array_merge($field, array($suffix))); $this->_secure($secure, array_merge($field, array($suffix)));
} }
if (version_compare(PHP_VERSION, '8.1.0', '>=')) {
$this->_secure($secure, array_merge($field, array('full_path')));
}
$exclude = array('name' => null, 'value' => null); $exclude = array('name' => null, 'value' => null);
return $this->Html->useTag('file', $options['name'], array_diff_key($options, $exclude)); return $this->Html->useTag('file', $options['name'], array_diff_key($options, $exclude));