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.3] Optional starting slash for elixir asset #17359

Merged
merged 1 commit into from
Jan 17, 2017
Merged

Conversation

BenCavens
Copy link
Contributor

The elixir() helper function requires urls to be passed without beginning slash. Otherwise an exception will be thrown.

Before this PR, elixir('/assets/img/logo.png') would result in an exception being thrown because the starting slash is not expected. This is because of the strict match with the asset keys in the manifest and those never start with a slash.

With this small addition, the starting slash will be allowed as well and gets silently accepted without error.

@BenCavens
Copy link
Contributor Author

FYI: This is a renewal of a previous closed PR #13525

@GrahamCampbell
Copy link
Member

Is this perhaps a breaking change? Maybe better for 5.4?

@BenCavens
Copy link
Contributor Author

In my opinion, it's backwards compatible since the current behaviour remains unchanged and as far as I know, I don't believe there is any code out there relying on catching this exception.

The change lies in the fact that the developer now avoids running into an exception when the path parameter has a leading slash.

@taylorotwell taylorotwell merged commit f34cfe6 into laravel:5.3 Jan 17, 2017
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.

3 participants