Dependency Graph
View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0032557 | mantisbt | bugtracker | public | 2023-05-17 21:10 | 2025-02-21 18:30 |
Reporter | adachi | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 2.23.0 | ||||
Target Version | 2.26.4 | Fixed in Version | 2.26.4 | ||
Summary | 0032557: Can not set full URL to $g_manual_url in config_inc.php | ||||
Description | For example, my site URL is "https://www.sample.com/". | ||||
Tags | No tags attached. | ||||
related to | 0016995 | closed | dregad | Absolute g_manual_url becomes relative on proj_doc_page.php |
has duplicate | 0034677 | closed | dregad | User documentation URL is wrong |
related to | 0032703 | closed | dregad | Local documentation is not accessible (403) |
related to | 0035322 | closed | community | Incorrect absolute URL in the tab menu |
There was a long discussion about this issue, see 0016995 and related GitHub pull request https://github.com/mantisbt/mantisbt/pull/144 The fix I committed back then worked, until a refactoring of the menu building functions broke it again as it channelled the URL again to helper_mantis_url() function. Considering there was a pretty strong stance at the time against allowing helper_mantis_url() to handle absolute URLs, I'm not really sure how else this could be handled now. |
|
@dregad
|
|
Well that is the problem exactly ! This cannot currently be done, because the code relies on the standard print_menu() function, which always channels the menu item's URL through helper_mantis_url(). So the simplest and most logical fix, would be to let helper_mantis_url() return absolute URLs as-is. An alternative could be to introduce a flag in the array of menu items passed on to print_menu(), indicating whether the given URL is absolute, and only pass it on to helper_mantis_url() if not. A bit of a hack I guess, but it would be quite easy to implement. |
|
@dregad concerning
Why do you need the flag whether the given URL is absolute? |
|
The absolute URL scenario is a corner case, currently used only for the Admin Guide link (and maybe some plugins); using the flag avoids executing a parse_url() call for every single menu item displayed to detect the URL type (absolute or relative), when the caller actually already knows what it is sending to print_menu(). So my idea was to optimize performance. Maybe using preg_match() with an appropriate regex would be slightly faster than parse_url(), and I guess you could even argue that the gain is negligible anyway, so maybe we should favor user convenience over execution speed here. |
|
MantisBT: master-2.26 952cbc28 2024-09-20 12:55 Details Diff |
Fix broken absolute URL on proj_doc_page.php Introduce 'absolute' flag in print_menu() items, allowing caller to decide whether helper_mantis_url() needs to be called on the given url or not. Fixes 0032557 |
Affected Issues 0032557 |
|
mod - core/html_api.php | Diff File |