Added isset check for REMOTE_ADDR

getIpAddressFromProxy failed while unit-testing, because there is no REMOTE_ADDR set. Now there is a check to see if it is set before trying to check if it is in the trustedProxies array.
Added a unit-test for my fix
Removed trailing spaces
Fixed unit test

Added a check to see if REMOTE_ADDR has been set.
Merge pull request #5418 from AxaliaN/patch-1

Added isset check for REMOTE_ADDR
Merge branch 'hotfix/5418'

Close #5418