We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
It seems that Storage::url() doesn't correctly generate the URL when you use a root path and grabs it as a slash in encoded html.
Without the root path it correctly generates the url.
When I give it the url parameter (with the fixed url) it works but it also adds the slash backwards.
This added "%5C" for the slash in the url.
// Filesystem.php 's3' => [ 'driver' => 's3', 'key' => env('S3_ACCESS_KEY_ID'), 'secret' => env('S3_SECRET_ACCESS_KEY'), 'region' => env('S3_DEFAULT_REGION', 'eu-central-1'), 'bucket' => env('S3_BUCKET'), 'endpoint' => env('S3_ENDPOINT', 'https://s3.xxxxx.com'), 'root' => 'test', //'url' => "https://bucketyyy.s3.xxxxxx.com/", ],
>>> Storage::disk('s3')->url('profile-photos/123.jpg') => "https://bucketyyy.s3.xxxxxx.com/test%5Cprofile-photos/123.jpg" >>> Storage::disk('s3')->path('profile-photos/123.jpg') => "test\profile-photos/123.jpg"
but if I add the url parameter and pass it directly to it, it will use the url correctly:
// Filesystem.php 's3' => [ 'driver' => 's3', 'key' => env('S3_ACCESS_KEY_ID'), 'secret' => env('S3_SECRET_ACCESS_KEY'), 'region' => env('S3_DEFAULT_REGION', 'eu-central-1'), 'bucket' => env('S3_BUCKET'), 'endpoint' => env('S3_ENDPOINT', 'https://s3.xxxxx.com'), 'root' => 'test', 'url' => "https://bucketyyy.s3.xxxxxx.com/", ],
>>> Storage::disk('s3')->url('profile-photos/123.jpg') => "https://bucketyyy.s3.xxxxxx.com/test\profile-photos/123.jpg" >>> Storage::disk('s3')->path('profile-photos/123.jpg') => "test\profile-photos/123.jpg"
// Filesystem.php 's3' => [ 'driver' => 's3', 'key' => env('S3_ACCESS_KEY_ID'), 'secret' => env('S3_SECRET_ACCESS_KEY'), 'region' => env('S3_DEFAULT_REGION', 'eu-central-1'), 'bucket' => env('S3_BUCKET'), 'endpoint' => env('S3_ENDPOINT', 'https://s3.xxxxx.com'), ],
>>> Storage::disk('s3')->url('profile-photos/123.jpg') => "https://bucketyyy.s3.xxxxxx.com/profile-photos/123.jpg" >>> Storage::disk('s3')->path('profile-photos/123.jpg') => "profile-photos/123.jpg"
Thanks!
The text was updated successfully, but these errors were encountered:
Heya, this isn't a Laravel issue but an AWS SDK issue I think. See #41964 & https://github.com/thephpleague/flysystem-aws-s3-v3/issues/293
Sorry, something went wrong.
Just had this behaviour with backup package My config was
'my-backup' => [ 'driver' => 's3', 'key' => 'key', 'secret' => 'key', 'region' => 'my-1', 'bucket' => 'bckps', 'root' => '/', 'endpoint' => 'https://example.com', 'use_path_style_endpoint' => true, ],
And I got this nice path generation
dd(\Storage::disk('my-backup')->allFiles('toapp'));
array:34 [▼ 0 => "oapp/2022-03-27-00-15-02.zip" 1 => "oapp/2022-04-10-00-15-02.zip" ....
as u can see I got path toapp converted to oapp
toapp
oapp
I know this one is closed but yes I confirm the bug still exist with root set to "/".
No branches or pull requests
Description:
Hi,
It seems that Storage::url() doesn't correctly generate the URL when you use a root path and grabs it as a slash in encoded html.
Without the root path it correctly generates the url.
When I give it the url parameter (with the fixed url) it works but it also adds the slash backwards.
With root path
This added "%5C" for the slash in the url.
with Root path + url
but if I add the url parameter and pass it directly to it, it will use the url correctly:
Without root path and url [OK]
Thanks!
The text was updated successfully, but these errors were encountered: