diff options
author | Miks Kronkalns <miks.kronkalns@zabbix.com> | 2021-05-27 17:06:06 +0300 |
---|---|---|
committer | Miks Kronkalns <miks.kronkalns@zabbix.com> | 2021-05-27 17:06:38 +0300 |
commit | c9dc150da680f3a15602dd64f79a8c569ff26d02 (patch) | |
tree | 01ccc81394bfabf472ff32c5a28d0a80b7b64bcb /ui/app/controllers | |
parent | 75118998ab154d30cdaf426388563c6e2c78a367 (diff) |
..F....... [ZBX-19255] fixed update of http headers fields in item and item prototype mass update form
Diffstat (limited to 'ui/app/controllers')
-rw-r--r-- | ui/app/controllers/CControllerPopupMassupdateItem.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ui/app/controllers/CControllerPopupMassupdateItem.php b/ui/app/controllers/CControllerPopupMassupdateItem.php index 2a5238468ca..6ff7d38ae3f 100644 --- a/ui/app/controllers/CControllerPopupMassupdateItem.php +++ b/ui/app/controllers/CControllerPopupMassupdateItem.php @@ -255,10 +255,17 @@ class CControllerPopupMassupdateItem extends CController { } if (array_key_exists('headers', $input) && $input['headers']) { - $headers = (count($input['headers']['name']) == count($input['headers']['value'])) - ? array_combine($input['headers']['name'], $input['headers']['value']) + $headers = []; + foreach ($input['headers']['name'] as $i => $header_name) { + if (array_key_exists($i, $input['headers']['value'])) { + $headers[$header_name] = $input['headers']['value'][$i]; + } + } + + // Ignore single row if it is empty. + $input['headers'] = ($headers !== ['' => '']) + ? $headers : []; - $input['headers'] = array_filter($headers, 'strlen'); } if (array_key_exists('preprocessing', $input) && $input['preprocessing']) { |