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 44 * See COPYING.txt for license details.
55 */
66
7- declare (strict_types=1 );
8-
97namespace Magento \Framework \HTTP \PhpEnvironment ;
108
119use Magento \Framework \App \RequestInterface ;
@@ -104,9 +102,9 @@ function (string $ip) {
104102 return !in_array (trim ($ ip ), $ this ->trustedProxies , true );
105103 }
106104 );
107- $ remoteAddress = trim (( string ) array_pop ($ ipList ));
105+ $ remoteAddress = trim (array_pop ($ ipList ));
108106 } else {
109- $ remoteAddress = trim (( string ) reset ($ ipList ));
107+ $ remoteAddress = trim (reset ($ ipList ));
110108 }
111109
112110 return $ remoteAddress ?: null ;
@@ -125,7 +123,7 @@ function (string $ip) {
125123 public function getRemoteAddress (bool $ ipToLong = false )
126124 {
127125 if ($ this ->remoteAddress !== null ) {
128- return $ ipToLong && $ this -> remoteAddress ? ip2long ($ this ->remoteAddress ) : $ this ->remoteAddress ;
126+ return $ ipToLong ? ip2long ($ this ->remoteAddress ) : $ this ->remoteAddress ;
129127 }
130128
131129 $ remoteAddress = $ this ->readAddress ();
@@ -144,7 +142,7 @@ public function getRemoteAddress(bool $ipToLong = false)
144142
145143 $ this ->remoteAddress = $ remoteAddress ;
146144
147- return $ ipToLong && $ this -> remoteAddress ? ip2long ($ this ->remoteAddress ) : $ this ->remoteAddress ;
145+ return $ ipToLong ? ip2long ($ this ->remoteAddress ) : $ this ->remoteAddress ;
148146 }
149147
150148 /**
You can’t perform that action at this time.
0 commit comments