From fa30c211238c939ae2f2f81af682d6be9326bce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20Eugon=C3=A9?= Date: Tue, 11 Jun 2024 08:45:34 +0200 Subject: [PATCH] Fixed potentially undefined uri from stream_get_meta_data --- src/Sitemap/DumpingUrlset.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Sitemap/DumpingUrlset.php b/src/Sitemap/DumpingUrlset.php index 6efc3f5..bbd1e4e 100644 --- a/src/Sitemap/DumpingUrlset.php +++ b/src/Sitemap/DumpingUrlset.php @@ -58,8 +58,10 @@ public function save(string $targetDir, bool $gzip = false): void $streamInfo = stream_get_meta_data($this->bodyFile); fclose($this->bodyFile); - // removing temporary file - unlink($streamInfo['uri']); + if (isset($streamInfo['uri'])) { + // removing temporary file + unlink($streamInfo['uri']); + } if ($gzip) { $this->loc .= '.gz';