-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
Strip base_url only from beginning of relative url #15418
Conversation
@Jako I can not reproduce it. I tried to find such a system setting, but it does not exist. Also, I tried changing it directly in |
The setting is used i.e. in LangRouter/xRouting + Babel sites as context setting with a different value than |
Why did you add that label? |
@Jako — does this issue apply to 3.x, as well? |
Maybe, the JavaScript can be the same. |
Yes, https://github.com/modxcms/revolution/blob/3.x/manager/assets/modext/widgets/resource/modx.panel.resource.static.js uses the same code and it should be fixed for 3.x too. |
What does it do?
Use a regular expression to replace MODx.config.base_url only at the beginning of the submitted relative url.
Why is it needed?
MODx.config.base_url should only occur at the beginning of the beginning of the submitted relative url. Currently it is stripped everywhere in the string.
How to test
Set the value of the base_url system setting to i.e. '/test/' and create/edit a static resource. Browse for the static resource file and edit the path at the bottom manually afterwards and insert the string '/test/' somewhere in that path. Before it will be replaced everywhere, afterwards it is only replaced at the start of the string.
Related issue(s)/PR(s)
None known.