ClientIP(true) returns a wrong ip address in a environment with multiple proxys.
When users want to use our dokuwiki (which is behind a apache-proxy-server) via our squid-proxy the function clientIP returns the IP of the Apache-Proxy instead of the IP of the Squid-Proxy (The Squid-Proxy does not set the real Client-IP via X_FORWARDED_FOR).
In debug mode you can see
[HTTP_X_FORWARDED_FOR] => unknown, 141.xxx.xxx.xxx
As mentioned in a comment at php.net [1] the comma-separated list in "HTTP_X_FORWARDED_FOR" can contain whitespaces which should be deleted.
[1]
http://www.php.net/manual/en/function.getenv.php#92412