Skip to content

Commit

Permalink
Fixed potentially undefined uri from stream_get_meta_data (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
yann-eugone authored Jun 11, 2024
1 parent d5ea628 commit e155893
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Sitemap/DumpingUrlset.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit e155893

Please sign in to comment.