View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0011534 | mantisbt | webpage | public | 2010-02-23 05:48 | 2010-04-23 14:30 |
Reporter | bmencke | Assigned To | jreese | ||
Priority | low | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.0 | ||||
Target Version | 1.2.1 | Fixed in Version | 1.2.1 | ||
Summary | 0011534: Incorrect url/path detection | ||||
Description | Upgraded to Mantis 1.2.0 (stable) and noticed, that in my url appears a doubleslash. The url looks like this: http://mantis.example.com//my_view_page.php | ||||
Tags | No tags attached. | ||||
has duplicate | 0011796 | closed | atrol | Separator char in link |
has duplicate | 0011809 | closed | atrol | Wrong paths |
has duplicate | 0009577 | closed | jreese | "Wrong" Links when using symlink for Mantis directory |
has duplicate | 0010652 | closed | jreese | Clean install returns errors if Mantis installed in root |
has duplicate | 0011700 | closed | jreese | Root path is incorrect in rendered html |
related to | 0011917 | closed | jreese | CSS not working on pages in /admin |
Tried to open mantis via firefox 3.6. Page does not display correctly. |
|
First check whether your config_inc.php contains anything of your old installation which must not longer be set there. (especially any paths) A virgin config_inc.php of 1.2.0 contains nothing more than something like You should also check the settings of Is your server running Windows? |
|
Okay checked. Variables containig this: SCRIPT_NAME /phpinfo.php and yes my server is running under windows. its a basic xampp 1.7.3 installation |
|
Okay i solved my problem with moving mantis to a subfolder. |
|
This is a problem with the URL guessing algorithms duplicating the trailing /. IN the mean time, if you explicitly set $g_path in your config_inc to http://mantis.example.com without the trailing slash, that should fix the problem for your installation. Targetting a proper fix for next 1.2 release. |
|
I vote that we remove the automatic path/URL stuff from config_defaults_inc.php and instead integrate it into the installer somehow? |
|
I am no specialist of PHP and tbh until now not really knowing how sessions are working or what require_once exactly means. If I understand the idea of dhx, the code which runs now for every session should run only one time during install. I like the idea of having the lowest base overhead per request which is possible. At the other side there will be a loss of convenience for the administrator (when moving an installation, changing protocol, ...) Keep in mind that one instance of MantisBT might be connected over http and https, so $t_protocol variable will be set different during runtime. @dhx: would be nice if you could explain me (or provide a good link for a short description of the concepts) how often the code in config_defaults_inc.php is interpreted in the current implementation, for example when am user logs in, enters an issue, after that views another issues, ... |
|
I'm personally against removing the path/url detection. There are multiple use cases for being able to detect this on the fly, mostly useful for sites with multiple entry points with different URLs. For instance, I work with a site that exposes a single tracker via multiple domains and protocols. "Internal" access over the local subnet uses a url like http://server/mantis/, and external user access uses urls like https://domain1.com/mantis/ and https://bugs.domain2.com/. Without being able to detect those paths on the fly, this sort of usage would not be possible. Honestly, it just needs to have someone sit down and fix some of the edge cases, and then it should work just fine. Hopefully I can do so in the near future. |
|
http://www.mantisbt.org/bugs/view.php?id=11700 1) On opening http://bt.example.com system trying to open If I open directly http://bt.example.com/my_view_page.php/ 2) |
|
I believe I have a proper fix for this problem. I've pushed the fix to my proposal repo [1] and would like some feedback on the patch, especially from anyone running MantisBT on a Windows server or IIS. [1] http://git.mantisforge.org/w/mantisbt/jreese.git?a=commit;h=2a5a0bc17f72e2cdf560fd4a4f912c5d5e7c3665 |
|
Fix committed to 1.2.x and master branches. |
|
MantisBT: master-1.2.x 0fc80e9f 2010-04-19 09:28 Details Diff |
Fix 0011534: Incorrect path/short_path detection Rather than attempting to try and decipher the path and short_path by comparing the file's location on the filesytem with the document_root, MantisBT should be looking at the PHP_SELF server var provided by PHP. This variable is based on the current URL used to access the file, and is not confused by symlinks or the document_root pointing directly to the installation. It is also much simpler than the old method. Tested on Linux and Windows with the following setups: - installed as subdomain, eg http://mantis.host/foo.php - installed in subdirectory, eg http://host/mantisbt/foo.php - accessed by symlink (Linux), eg http://host/mantis/foo.php where /var/www/mantis -> /usr/share/mantisbt |
Affected Issues 0011534 |
|
mod - config_defaults_inc.php | Diff File | ||
MantisBT: master 5ac1fdf3 2010-04-19 09:28 Details Diff |
Fix 0011534: Incorrect path/short_path detection Rather than attempting to try and decipher the path and short_path by comparing the file's location on the filesytem with the document_root, MantisBT should be looking at the PHP_SELF server var provided by PHP. This variable is based on the current URL used to access the file, and is not confused by symlinks or the document_root pointing directly to the installation. It is also much simpler than the old method. Tested on Linux and Windows with the following setups: - installed as subdomain, eg http://mantis.host/foo.php - installed in subdirectory, eg http://host/mantisbt/foo.php - accessed by symlink (Linux), eg http://host/mantis/foo.php where /var/www/mantis -> /usr/share/mantisbt |
Affected Issues 0011534 |
|
mod - config_defaults_inc.php | Diff File |