Bug (approved)

SELF_URL not auto-detected when rewrite enabled

Summary

approved
Feb 19, 2009
30 min ... 30 min
100%
Jan 11, 2011
Feb 19, 2009 / themightychris
Jan 11, 2011 / pixtur
 

Attached files

No files uploaded
 
This task does not have any text yet.
Doubleclick here to add some.

Issue report

Minor
Always
Apache/2.2.11 Server, PHP5.2.8-r2
0.0902
2009-12-21
  • Fresh install of 902, enable USE_MOD_REWRITE in customize.inc.php and apply the apache configuration.
  • Create a new person with account and email address. Logout.
The links in the notification emails are missing SELF_URL. The code that attempts to initialize SELF_URL automatically checks for "/index.php" in SCRIPT_NAME. If rewriting is on that won't match

from conf/conf.inc.php

/**
* try to figure out url installation for links from notification mails
*/
if(isset($_SERVER['SCRIPT_NAME']) && $_SERVER['HTTP_HOST'] && preg_match("/\/index\.php/",$_SERVER['SCRIPT_NAME'])) {

    $url= asCleanString($_SERVER['HTTP_HOST'] .$_SERVER['SCRIPT_NAME']);
    confChange('SELF_URL', $url);
}
+
elseif( $_SERVER['HTTP_HOST'] )
{
	$url = asCleanString($_SERVER['HTTP_HOST']);
	confChange('SELF_URL', $url);
}
 

2 Comments

luchyx:Reproducible

9 years ago

This also happen in the RSS feed.

See: http://www.streber-pm.org/index.php?go=projViewAsRSS&prj=5

You will links like
http://www.streber-pm.org/?go=itemView&item=7687

pixtur:Cool!

9 years ago

I will add this to code. Thanks for your help!