-
Problem report
-
Resolution: Unresolved
-
Trivial
-
None
-
5.2.0alpha1
Steps to reproduce error 1:
Create incorrect API request for method host.massremove
{ "hosts":[{"hostid": "10337"}], "interfaces": [{ "ip": "194.168.3.1", "dns": "", "port": "10050" }] }
Notice: "hosts" property is incorrect.
Result 1:
PHP Fatal error: Uncaught TypeError: Argument 1 passed to CHost::checkPermissions() must be of the type array, null given, called in /var/www/html/feature/ZBXNEXT-2156-5.1/ui/include/classes/api/services/CHost.php on line 1342 and defined in /var/www/html/feature/ZBXNEXT-2156-5.1/ui/include/classes/api/services/CHost.php:1778
Steps to reproduce error 2:
Create incorrect API request for method host.massremove
{ "hostids":[{"hostid": "10337"}], "interfaces": [{ "ip": "194.168.3.1", "dns": "", "port": "10050" }] }
Notice: "hostids" property is incorrect.
Result 2:
PHP Warning: array_flip(): Can only flip STRING and INTEGER values! in /var/www/html/feature/ZBXNEXT-2156-5.1/ui/include/db.inc.php on line 634" PHP Warning: pg_query(): Query failed: ERROR: syntax error at or near "AND"" "LINE 1: ...owscount FROM hosts h WHERE h.flags IN (0,4) AND AND h.stat..." in /var/www/html/feature/ZBXNEXT-2156-5.1/ui/include/db.inc.php on line 247"
Expected:
- Graceful failure if uncaught.
- No failure in given example.
Only tested in 5.2.0alpha1, please see if this issue exists earlier.
- part of
-
ZBX-3783 Proper API validation
- Reopened