Skip to content

Commit 74d33de

Browse files
#32676: Mark classes and interfaces as API part 7 - ip2long param type fix.
1 parent 1691f0d commit 74d33de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/Magento/Framework/HTTP/PhpEnvironment/RemoteAddress.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function (string $ip) {
125125
public function getRemoteAddress(bool $ipToLong = false)
126126
{
127127
if ($this->remoteAddress !== null) {
128-
return $ipToLong ? ip2long($this->remoteAddress) : $this->remoteAddress;
128+
return $ipToLong && $this->remoteAddress ? ip2long($this->remoteAddress) : $this->remoteAddress;
129129
}
130130

131131
$remoteAddress = $this->readAddress();
@@ -144,7 +144,7 @@ public function getRemoteAddress(bool $ipToLong = false)
144144

145145
$this->remoteAddress = $remoteAddress;
146146

147-
return $ipToLong ? ip2long($this->remoteAddress) : $this->remoteAddress;
147+
return $ipToLong && $this->remoteAddress ? ip2long($this->remoteAddress) : $this->remoteAddress;
148148
}
149149

150150
/**

0 commit comments

Comments
 (0)