Reported by Damian Tommasino in https://support.zabbix.com/browse/ZBX-3840?focusedCommentId=43000&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_43000.
(1) Please review my changes in r24957. If everything is ok, you can merge.
I had another look and realized, that there is a better way to fix it.
I've implemented a stricter parameter validation. Please review.
Please review my changes in rev. 25068.
<pavels> Thanks, CLOSED.
Merged to 1.8 r25074.
The fix for the trunk is available in /branches/dev/ZBX-3955-trunk.
Merged to trunk r25132.