Please sign in to comment.
[#25161833] Clean up IP address parsing
If there's more than one proxy standing between the client and Koha's web server, the HTTP_X_FORWARDED_FOR header may contain more than one IP address. C4::Branch::GetBranchByIp was not prepared for this condition, and it would cause an exception. There are also some proxies which insert a non-IP value into the HTTP_X_FORWARDED_FOR header (e.g. "unknown") to protect privacy or who knows why. This would bunge up Koha's IP detection. This patch looks for something that looks like a good address, then if all else fails it resorts to reporting that the client is not in any branch.
- Loading branch information...