Skip to content
New issue

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

[5.x] Asset Container returns relative url for same site #11372

Open
wants to merge 4 commits into
base: 5.x
Choose a base branch
from

Conversation

marcorieser
Copy link
Contributor

Fixes #11371

if (str_starts_with($url, config('app.url'))) {
$url = substr($url, strlen(config('app.url')));
}

Copy link
Contributor

Choose a reason for hiding this comment

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

why not Str::removeLeft here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@edalzell I only found Str::chopStart() but that's not available in Laravel 10, so I did it the traditional way but if that's available... sure! Much nicer. Will check... Should have ask my coworker.

Copy link
Contributor

Choose a reason for hiding this comment

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

You certainly should have. It's a Statamic function not Laravel, they extend Laravel's Str.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Glide handles images on public disk via the http route
2 participants