From 7cdf7d24892efaadf954564567c661eba868d7b4 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 27 Sep 2020 15:03:19 +0200 Subject: [PATCH] [Filesystem] fix for PHP 8 --- Filesystem.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Filesystem.php b/Filesystem.php index 0dda9f28af..a6e8715256 100644 --- a/Filesystem.php +++ b/Filesystem.php @@ -599,13 +599,13 @@ public function mirror($originDir, $targetDir, \Traversable $iterator = null, $o */ public function isAbsolutePath($file) { - return strspn($file, '/\\', 0, 1) + return '' !== (string) $file && (strspn($file, '/\\', 0, 1) || (\strlen($file) > 3 && ctype_alpha($file[0]) && ':' === $file[1] && strspn($file, '/\\', 2, 1) ) || null !== parse_url($file, \PHP_URL_SCHEME) - ; + ); } /**