Cleanups to WebRequest::getIP logic
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 7 Jun 2014 00:20:47 +0000 (17:20 -0700)
committerOri Livneh <ori@wikimedia.org>
Wed, 11 Jun 2014 16:59:14 +0000 (09:59 -0700)
commit5d6864ccf157dbcd78e2a43a0ba0382be0f9b677
treec3ab921aa35a0ff53302c6d5f3d907a1b0c0646a
parent36174b76ea9ff6c2e75361865f21b75f212285fa
Cleanups to WebRequest::getIP logic

* Throw an error if there is no immediate server IP, otherwise the
  XFF logic is wonky.
* Refactored the loop to be a bit easier to read.
* Better handle "unknown" entries in the XFF chain.

Change-Id: I9541afa408d895c3fd337a883ecfe4ce0ba57090
includes/WebRequest.php