Fix wikifying of root-relative links #330
No reviewers
Labels
No labels
Component: User interface
Component: Wymeditor
Help wanted
Level: Difficult
Level: Easy
Level: Moderate
Pagetype: Festival
Pagetype: Mailinglist
Pagetype: Peer reviewed article
Pagetype: Text
Privacy GDPR AVG
status: has conflicts
Status: Needs changes
Status: Needs discussion
Status: Needs review
Status: Ready to merge
Status: Waiting for response
Type: Bug
Type: Enhancement
Type: Question
Usecase: De Stadsbron
Usecase: Koppelting
Usecase: MeetjeStad
Value: Coders
Value: Security
Value: Users
Value: Visitors
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
harmen/hypha!330
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "root-relative-links"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This makes sure that a link like
/en/pagenameis properly wikified too, rather than justen/pagenameorhttps://domain.tld/en/pagename.Please check my comment.
Could this lead to an issue if the site can be accessed through multiple domains?
eg. http(s)://(www.)mydomain.tld/path/en/pagename
https://www.mydomain.tld/path/en/pagename
http://www.mydomain.tld/path/en/pagename
https://mydomain.tld/path/en/pagename
http://mydomain.tld/path/en/pagename
Yes, it could. However, this is already the case with the current code (that part is not really changed, just refactored to use
HyphaRequest::getRootUrlrather than global$hyphaUrl, I just split this commit into two to emphasize this).Also, this is only a problem when someone externally adds a URL to another version (another equivalent domain or http vs https) of the site, since all urls internally generated use the same url as is removed here. IOW, once the url is made relative once, it gets stored in the database relatively properly, and is potentially expanded to an absolute URL when e.g. editing the page, but can then always be made relative again when saving.
Also, we cannot really fix this properly now: The PHP code has no idea about the different domains that the site is available under. The only way AFAICS to fix this is to configure these domains manually, which makes this a lot more complex. So I would leave this problem unsolved for now, certainly within this PR>
I rebased on top of master and split the last commit in two. The first commit has disappeared, since it was already merged in another PR. I would think this is ready to merge now.