Carbon locale

This commit is contained in:
xiaomlove
2022-04-09 01:54:40 +08:00
parent fe4f7a204f
commit 93f8031ccd
3 changed files with 9 additions and 1 deletions

View File

@@ -129,6 +129,12 @@ final class Nexus
}
foreach ($fields as $field) {
$result = $servers[$field] ?? null;
if ($result && in_array($field, ['HTTP_X_FORWARDED_FOR', 'x-forwarded-for'])) {
$result = preg_split('/[,\s]+/', $result);
}
if (is_array($result)) {
$result = Arr::first($result);
}
if ($result !== null && $result !== '') {
return $result;
}