-
Problem report
-
Resolution: Fixed
-
Trivial
-
4.4.0, 5.0.0alpha1
-
Sprint 57 (Oct 2019), Sprint 58 (Nov 2019)
-
0.125
Steps to reproduce:
This can be reproduced everywhere where array_db rule is used, just passing non-array value. ** Here is an example with value mapping (assuming that ZBXNEXT-5486 is merged):
- Navigate to Administration -> General -> Value mapping
- Open single value map
- Using inspect element, select "delete" button and remove urlencoded "[]" part from it's redirect target (field "valuemapids" should become an integer).
- Press "delete" and let fatal error happen
Result:
Before nicely formatted errors there are following errors visible:
Argument 1 passed to CNewValidator::is_array_db() must be of the type array, string given, called in /var/www/zabbix/frontends/php/include/classes/validators/CNewValidator.php on line 187 and defined [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerValuemapDelete->checkInput() → CController->validateInput() → CNewValidator->__construct() → CNewValidator->validate() → CNewValidator->validateField() → CNewValidator->is_array_db() in include/classes/validators/CNewValidator.php:386] Invalid argument supplied for foreach() [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerValuemapDelete->checkInput() → CController->validateInput() → CNewValidator->__construct() → CNewValidator->validate() → CNewValidator->validateField() → CNewValidator->is_array_db() in include/classes/validators/CNewValidator.php:389]
Expected:
There should be nicely formatted errors only in fatal error screen.