Skip to content

Commit

Permalink
Fixes #1820: Normalise paths for checksum calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdejonge committed Oct 8, 2024
1 parent 0adc0d9 commit e58b8a7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ public function publicUrl(string $path, array $config = []): string
?? throw UnableToGeneratePublicUrl::noGeneratorConfigured($path);
$config = $this->config->extend($config);

return $this->publicUrlGenerator->publicUrl($this->pathNormalizer->normalizePath($path), $config);
return $this->publicUrlGenerator->publicUrl(
$this->pathNormalizer->normalizePath($path),
$config,
);
}

public function temporaryUrl(string $path, DateTimeInterface $expiresAt, array $config = []): string
Expand All @@ -214,9 +217,15 @@ public function checksum(string $path, array $config = []): string
}

try {
return $this->adapter->checksum($path, $config);
return $this->adapter->checksum(
$this->pathNormalizer->normalizePath($path),
$config,
);
} catch (ChecksumAlgoIsNotSupported) {
return $this->calculateChecksumFromStream($path, $config);
return $this->calculateChecksumFromStream(
$this->pathNormalizer->normalizePath($path),
$config,
);
}
}

Expand Down

0 comments on commit e58b8a7

Please sign in to comment.