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

Fix - Allow properly-formatted path parameters to work (also fixes URL::to('/')'s output) #395

Merged
merged 4 commits into from Feb 24, 2013

Conversation

ghost
Copy link

@ghost ghost commented Feb 20, 2013

This fix allows properly-formatted path parameters (those beginning with a slash; e.g. "/path/to/page") to be used, without breaking past compatibility by still allowing ("path/to/page") to work. These path parameters are used in methods such as URL::to('/page'), Redirect::to('/page'), etc.

Also, because of how this change is done, it fixes an issue where the root site path was being output incorrectly by URL::to. URL::to('/') used to output http://domain.com (without a trailing slash), but now outputs http://domain.com/ as it should for the root URL.

So with this we can use:
Redirect::to('/')
Redirect::to('/about') (this now works)
Redirect::to('about') (the old way still works)

URL::to('/') - http://domain.com/ (now has the trailing slash for the root!)
URL::to('/path/to/page') - http://domain.com/path/to/page (this now works)
URL::to('path/to/page') - http://domain.com/path/to/page (the old way still works)

Jason added 3 commits February 20, 2013 15:49
This allows properly formatted path parameters to be used (those beginning with a trailing slash; e.g. "/path/to/page" & the root "/"), without breaking past compatibility by still allowing ("path/to/page"). These path parameters are used in methods such as URL::to('/page'), Redirect::to('/page'), etc.

Also, because of how this change is done, this fixes an issue where the root path was being output incorrectly by URL::to. URL::to('/') used to output "http://domain.com" (without a trailing slash), but now outputs "http://domain.com/" as it should for the root URL.
taylorotwell added a commit that referenced this pull request Feb 24, 2013
…')IsCorrect

Fix - Allow properly-formatted path parameters to work (also fixes URL::to('/')'s output)
@taylorotwell taylorotwell merged commit f627ef4 into laravel:master Feb 24, 2013
gonzalom pushed a commit to Hydrane/tmp-laravel-framework that referenced this pull request Oct 12, 2023
…e-replace-route

[5.2] Allow middleware to replace route info and route parameters
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.

None yet

1 participant