When you use a base_url setted in settings.php and this base_url contain a not empty base_path, the returned url from url() can have a doubled base_path like : http://host/base_path//base_path/.... Or /base_path//base_path/…
If you use, for instance, linkit in a link field, You can see this bug:
Case 1) If you use linkit to return a node path. Linkit return a path like "node/3" to the link field and url("node/3") return "http://host/base_path/node/3" => correct
Case 2) If you use linkit to return a file path. Linkit return a relative url like "/base_path/sites/mysite/files/…." to the link field and url("/base_path/sites/mysite/files/…") return "http://host/base_path//base_path/ sites/mysite/files/…" => wrong
But linkit works fine: "/base_path/sites/mysite/files/…." is a correct relative url. The mistake doesn't come from linkit or link modules but really from the url() function.
Conclusion:
When url() receives a path starting with a "/" it must be added only base_root or nothing (depending if it has been asked an absolute or relative url), and when it receives a path without "/" it must be added base_url or base_path (depending if it asked an absolute or relative url)
See patch below.
Needs work
7.0 ⚰️
Last updated
Changes an existing API or subsystem. Not backportable to earlier major versions, unless absolutely required to fix a critical bug.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.