Skip to content

Commit

Permalink
FIX FlysystemAssetStore::getAsURL() only grant for protected filesystems
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherdarling committed Sep 20, 2018
1 parent f580719 commit 16b3d18
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Flysystem/FlysystemAssetStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,6 @@ public function getAsString($filename, $hash, $variant = null)

public function getAsURL($filename, $hash, $variant = null, $grant = true)
{
if ($grant) {
$this->grant($filename, $hash);
}
$fileID = $this->getFileID($filename, $hash, $variant);

// Check with filesystem this asset exists in
Expand All @@ -230,6 +227,10 @@ public function getAsURL($filename, $hash, $variant = null, $grant = true)
$publicAdapter = $public->getAdapter();
return $publicAdapter->getPublicUrl($fileID);
} else {
if ($grant) {
$this->grant($filename, $hash);
}

/** @var ProtectedAdapter $protectedAdapter */
$protectedAdapter = $protected->getAdapter();
return $protectedAdapter->getProtectedUrl($fileID);
Expand Down

0 comments on commit 16b3d18

Please sign in to comment.