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 branch 'hotfix/5422'

Close #5422
Merge pull request #5418 from AxaliaN/patch-1

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

Forward port #5418