Skip to content

Commit

Permalink
BUGFIX: Make sure public URI gets escaped
Browse files Browse the repository at this point in the history
Employ guzzle PSR-7 Uri to make sure the generated
public URIs are properly escaped.
  • Loading branch information
kitsunet committed Nov 11, 2019
1 parent 2b42d37 commit 7a4d317
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Classes/GcsTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
use Google\Cloud\Storage\Bucket;
use Google\Cloud\Storage\StorageClient;
use Google\Cloud\Storage\StorageObject;
use GuzzleHttp\Psr7\Uri;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Http\Uri;
use Neos\Flow\Log\Utility\LogEnvironment;
use Neos\Flow\ObjectManagement\ObjectManagerInterface;
use Neos\Flow\ResourceManagement\CollectionInterface;
Expand Down Expand Up @@ -562,7 +562,9 @@ public function getPublicPersistentResourceUri(PersistentResource $resource): st
$customUri .= '?' . $signedStandardUri->getQuery();
}

return $customUri;
// Let Uri implementation take care of encoding the Uri
$uri = new Uri($customUri);
return (string)$uri;
}

/**
Expand Down

1 comment on commit 7a4d317

@kitsunet
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still no good fix because the parsing of the Uri string might create a wrong result, we know the components of the Uri so we should deliver them like that to ensure that the encoding is correct (think # in file name)

Please sign in to comment.