red-tux/zbxapi — pull request #29 by Sheile (2014-11-13 06:04:04+00:00)
Title: Skip authentication to get API version

Zabbix 2.2.3 compare case sensitive method name to skip authentication.
I request `APIInfo.version` and `apiinfo.version` to my zabbix server by curl.
`APIInfo.version` returns `"error":{"code":-32602,"message":"Invalid params.","data":"Not authorized"}`
`apiinfo.version` returns `"result":"2.2.3"` successfully.

Latest version of zabbix 2.2.x also has same compare logic.
Following code is `frontends/php/api/rpc/class.czbxrpc.php` in zabbix 2.2.7.
```
42 // list of methods which does not require authentication
43 $withoutAuth = array(
44 'user.login' => 1,
45 'user.checkAuthentication' => 1,
46 'apiinfo.version' => 1
47 );
48 // Authentication
49 if (!isset($withoutAuth[$method]) || !zbx_empty($sessionid)) {
```