[eluser]helmutbjorg[/eluser]
Hi Guys,
This isn't really a bug but thought I might mention it.
In index.php when setting the $system_folder variable I noticed a slight problem. The realpath would not be determined if a relative address was given for the system folder. When entering '../system' (a relative address) into the $system_folder variable caused the system to assume it was an absolute address.
Here is the code in question from index.php
Code:
/*
|---------------------------------------------------------------
| SET THE SERVER PATH
|---------------------------------------------------------------
|
| Let's attempt to determine the full-server path to the "system"
| folder in order to reduce the possibility of path problems.
| Note: We only attempt this if the user hasn't specified a
| full server path.
|
*/
if (strpos($system_folder, '/') === FALSE)
{
if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
{
$system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
}
}
else
{
// Swap directory separators to Unix style for consistency
$system_folder = str_replace("\\", "/", $system_folder);
}
Note how it says
Quote:Note: We only attempt this if the user hasn't specified a
| full server path.
and it determines that through
Code:
if (strpos($system_folder, '/') === FALSE)
I suggest changing this to
Code:
if (strpos($system_folder, '/') !== 0)
This change makes the system only assume an absolute address if the first character is a forward slash. Eg. /apps/system = absolute, ../system = relative. Which is more correct in my opinion. Not many folks would have a problem with this but it caught me out today.