Skip to content

Commit ec5cb2f

Browse files
committed
refactor: add workaround for old Config\App file
1 parent 3bb0831 commit ec5cb2f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

system/HTTP/RequestTrait.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ public function getIPAddress(): string
6666
// @phpstan-ignore-next-line
6767
$proxyIPs = $this->proxyIPs ?? config(App::class)->proxyIPs;
6868
// @phpstan-ignore-next-line
69+
70+
// Workaround for old Config\App file. App::$proxyIPs may be empty string.
71+
if ($proxyIPs === '') {
72+
$proxyIPs = [];
73+
}
6974
if (! empty($proxyIPs) && (! is_array($proxyIPs) || is_int(array_key_first($proxyIPs)))) {
7075
throw new ConfigException(
7176
'You must set an array with Proxy IP address key and HTTP header name value in Config\App::$proxyIPs.'

0 commit comments

Comments
 (0)