FIX Make backURL respect subdirectory path#11803
Merged
emteknetnz merged 1 commit intosilverstripe:6.0from Jul 27, 2025
Merged
Conversation
GuySartorelli
commented
Jul 25, 2025
| // e.g. `index.php/` | ||
| if (defined('BASE_SCRIPT_URL')) { | ||
| return $baseURL . BASE_SCRIPT_URL; | ||
| return rtrim($baseURL . BASE_SCRIPT_URL, '/') . '/'; |
Member
Author
There was a problem hiding this comment.
This is technically not related, but matches how the other two scenarios in this method work. This method should always return a value with a trailing slash.
2 tasks
d9e4856 to
d820364
Compare
d820364 to
a3c0cac
Compare
|
This works now. |
emteknetnz
approved these changes
Jul 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have also checked for other cases where the
backURLquery string gets set and those were all already using various ways to include the subdirectory in the path.I can't find a sensible way to directly test this, because the
SS_BASE_URLenvironment variable is consumed to set theBASE_URLconstant which happens during test bootstrapping, which is before I can get at it to update the test.Instead I've opted to use
Director.alternate_base_urlwhich at least checks thatDirector::baseURL()is being used correctly here.Issue
/is base #11769