File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
lib/internal/Magento/Framework/HTTP/PhpEnvironment Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 4
4
* See COPYING.txt for license details.
5
5
*/
6
6
7
- declare (strict_types=1 );
8
-
9
7
namespace Magento \Framework \HTTP \PhpEnvironment ;
10
8
11
9
use Magento \Framework \App \RequestInterface ;
@@ -104,9 +102,9 @@ function (string $ip) {
104
102
return !in_array (trim ($ ip ), $ this ->trustedProxies , true );
105
103
}
106
104
);
107
- $ remoteAddress = trim (( string ) array_pop ($ ipList ));
105
+ $ remoteAddress = trim (array_pop ($ ipList ));
108
106
} else {
109
- $ remoteAddress = trim (( string ) reset ($ ipList ));
107
+ $ remoteAddress = trim (reset ($ ipList ));
110
108
}
111
109
112
110
return $ remoteAddress ?: null ;
@@ -125,7 +123,7 @@ function (string $ip) {
125
123
public function getRemoteAddress (bool $ ipToLong = false )
126
124
{
127
125
if ($ this ->remoteAddress !== null ) {
128
- return $ ipToLong && $ this -> remoteAddress ? ip2long ($ this ->remoteAddress ) : $ this ->remoteAddress ;
126
+ return $ ipToLong ? ip2long ($ this ->remoteAddress ) : $ this ->remoteAddress ;
129
127
}
130
128
131
129
$ remoteAddress = $ this ->readAddress ();
@@ -144,7 +142,7 @@ public function getRemoteAddress(bool $ipToLong = false)
144
142
145
143
$ this ->remoteAddress = $ remoteAddress ;
146
144
147
- return $ ipToLong && $ this -> remoteAddress ? ip2long ($ this ->remoteAddress ) : $ this ->remoteAddress ;
145
+ return $ ipToLong ? ip2long ($ this ->remoteAddress ) : $ this ->remoteAddress ;
148
146
}
149
147
150
148
/**
You can’t perform that action at this time.
0 commit comments