View Issue Details

IDProjectCategoryView StatusLast Update
0014081mantisbtinstallationpublic2014-09-23 18:05
Reporterbsmither Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWindows Server 2003 
Product Version1.2.9 
Target Version1.2.12Fixed in Version1.2.12 
Summary0014081: Use of DIRECTORY_SEPARATOR in URLs
Description

Links created in:
function helper_mantis_url( $p_url )
or a dependent function, returns links such as:
<link rel="stylesheet" type="text/css"
href="http://site.com\/css/default.css" />

More info as soon as the real culprit is discovered.

TagsNo tags attached.
Attached Files
mbt129-admin-index.zip (2,052 bytes)

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

bsmither

bsmither

2012-03-23 18:57

reporter   ~0031518

This is specific to www.example.com/admin/index.php

There is also the by-product in which the backslash is converted to the three-character string %5C.

Also, I see no link (malformed or otherwise) for the file admin.css.

bsmither

bsmither

2012-03-23 19:14

reporter   ~0031519

Last edited: 2012-03-23 19:40

On Windows, this is what happens:
$_SERVER[PHP_SELF]: /index.php
dirname($_SERVER[PHP_SELF]: \

Suggest in config.defaults.inc.php, lines 118, 119, make sure to str_replace('\','/',$var).

Edit: Nope, that is not the correct solution.

rombert

rombert

2012-03-24 18:09

reporter   ~0031520

Can you attach an incorrect index.php as rendered in the browser?

bsmither

bsmither

2012-09-21 19:16

reporter   ~0032909

The attached file is the HTML as saved by the browser of the unmodified:
http://tracker.xxxxxxxxxxx.com/admin/index.php

I have since changed lines 118-119 from:

$t_path = basename( $t_path ) == "admin" ? dirname( $t_path ) . '/' : $t_path;
$t_path = basename( $t_path ) == "soap" ? dirname( dirname( $t_path ) ) . '/' : $t_path;

to:

$t_path = basename( $t_path ) == "admin" ? str_replace('\','',dirname( $t_path ) . '/') : $t_path;
$t_path = basename( $t_path ) == "soap" ? str_replace('\','',dirname( dirname( $t_path ) ) . '/') : $t_path;

dregad

dregad

2012-09-27 05:32

developer   ~0032965

Last edited: 2012-09-27 05:34

I suggest you have a look at the fix implemented in config_defaults_inc.php by grangeway in the master branch, I think addresses exactly this problem, albeit in a slightly different way.

https://github.com/mantisbt/mantisbt/blob/master/config_defaults_inc.php#L138

If you confirm that, I'll backport the change to 1.2.x

EDIT: added link to file on github

grangeway

grangeway

2013-04-05 17:56

reporter   ~0036206

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master-1.2.x 426fdbd1

2010-08-14 04:05

grangeway

Committer: Damien Regad


Details Diff
Fix $t_path on windows

Backported from master e7ee768d97e078a1a669ba6279671e58e9936ba8

Signed-off-by: Damien Regad <damien.regad@merckgroup.com>
Affected Issues
0014081
mod - config_defaults_inc.php Diff File

MantisBT: master e7ee768d

2010-08-14 11:05

grangeway


Details Diff
Fix $t_path on windows Affected Issues
0014081
mod - config_defaults_inc.php Diff File