Commit 84909d31 authored by Thomas Löffler's avatar Thomas Löffler

Cleaner code for getUserIP

parent e5f1cfb5
......@@ -555,15 +555,7 @@ class LanguageDetection extends AbstractPlugin
*/
protected function getUserIP():string
{
if ($ip = GeneralUtility::getIndpEnv('HTTP_CLIENT_IP')) {
return $ip;
}
if ($ip = GeneralUtility::getIndpEnv('HTTP_X_FORWARDED_FOR')) {
return $ip;
}
return GeneralUtility::getIndpEnv('REMOTE_ADDR');
return GeneralUtility::getIndpEnv('HTTP_CLIENT_IP') || GeneralUtility::getIndpEnv('HTTP_X_FORWARDED_FOR') || GeneralUtility::getIndpEnv('REMOTE_ADDR');
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment