From 7386ebd45a3956fd2e07077a75567cea52532776 Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Sat, 20 Apr 2024 13:00:39 +0200 Subject: [PATCH] Fixed #1761: map explicitly to ints. --- src/Ftp/FtpAdapter.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Ftp/FtpAdapter.php b/src/Ftp/FtpAdapter.php index 102fa0171..b15add8dc 100644 --- a/src/Ftp/FtpAdapter.php +++ b/src/Ftp/FtpAdapter.php @@ -27,6 +27,7 @@ use League\MimeTypeDetection\MimeTypeDetector; use Throwable; +use function array_map; use function error_clear_last; use function error_get_last; use function ftp_chdir; @@ -489,7 +490,9 @@ private function normalizePermissions(string $permissions): int // convert the groups $mapper = static function ($part) { - return array_sum(str_split($part)); + return array_sum(array_map(static function ($p) { + return (int) $p; + }, str_split($part))); }; // converts to decimal number