View Issue Details

IDProjectCategoryView StatusLast Update
0009383mantisbtwebpagepublic2008-08-11 09:41
ReporterMax_well Assigned Tograngeway  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformApache/2.2.3 PHP/5.2.0-8+etch11OSLinuxOS Version2.6.18.1
Product Version1.2.0a1 
Fixed in Version1.2.0a2 
Summary0009383: Wrong URL directory path computed (CSS & images and JS not accessible)
Description

When installed on the root of a domain, mantis fail to correctly compute the url path, corrupting the path of css, images and javascript (pages search for '//css/default.css' instead of '/css/default.css').

The file config_defaults_inc.php contains the following code :

Extract the unique directory path of this file relative to the server's documunt root

if ( preg_match( '@'.$t_docroot.'(.*)@', $t_file_path, $t_matches ) ) {
$t_path = dirname( strip_tags( $t_matches[1] ) );
} else {
$t_path = dirname( strip_tags( $_SERVER['PHP_SELF'] ) );
if ( '/' == $t_path || '\' == $t_path ) {
$t_path = '';
}
}

which should be replaced by :

Extract the unique directory path of this file relative to the server's documunt root

if ( preg_match( '@'.$t_docroot.'(.*)@', $t_file_path, $t_matches ) ) {
$t_path = dirname( strip_tags( $t_matches[1] ) );
if ( '/' == $t_path || '\' == $t_path ) {
$t_path = '';
}
} else {
$t_path = dirname( strip_tags( $_SERVER['PHP_SELF'] ) );
if ( '/' == $t_path || '\' == $t_path ) {
$t_path = '';
}
}

Steps To Reproduce

Install Mantis on the root of a domain name (ie. http://mantis.foo.org/).

TagsNo tags attached.

Activities

Max_well

Max_well

2008-07-14 07:27

reporter   ~0018498

Diff :

config_defaults_inc.php
119,121d118
< if ( '/' == $t_path || '\' == $t_path ) {
< $t_path = '';
< }

Max_well

Max_well

2008-07-15 09:12

reporter   ~0018546

Last edited: 2008-07-15 09:18

Bug 0009112 and 0009266 report the same bug.

grangeway

grangeway

2008-07-31 15:13

reporter   ~0018968

I've fixed this issue by rtrim'ing / from the trailing end in svn.

Paul