mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-22 13:58:40 +01:00
a (hopefully) more windows-compatible way to add the missing slash in the docroot of some webservers
This commit is contained in:
parent
ea7f4ffde7
commit
195d12e131
@ -28,6 +28,14 @@ class html
|
|||||||
|
|
||||||
$this->prefered_img_title = $this->user_agent == 'mozilla' && $this->ua_version < 5 ? 'ALT' : 'TITLE';
|
$this->prefered_img_title = $this->user_agent == 'mozilla' && $this->ua_version < 5 ? 'ALT' : 'TITLE';
|
||||||
//echo "<p>HTTP_USER_AGENT='$GLOBALS[HTTP_USER_AGENT]', UserAgent: '$this->user_agent', Version: '$this->ua_version', img_title: '$this->prefered_img_title'</p>\n";
|
//echo "<p>HTTP_USER_AGENT='$GLOBALS[HTTP_USER_AGENT]', UserAgent: '$this->user_agent', Version: '$this->ua_version', img_title: '$this->prefered_img_title'</p>\n";
|
||||||
|
|
||||||
|
$this->document_root = $_SERVER['DOCUMENT_ROOT'];
|
||||||
|
// this is because some webservers report their docroot without the leading slash
|
||||||
|
if (!is_dir($this->document_root) && is_dir('/'.$this->document_root))
|
||||||
|
{
|
||||||
|
$this->document_root = '/' . $this->document_root;
|
||||||
|
}
|
||||||
|
//echo "<p>_SERVER[DOCUMENT_ROOT]='$_SERVER[DOCUMENT_ROOT]', this->document_root='$this->document_root'</p>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -275,8 +283,7 @@ class html
|
|||||||
{
|
{
|
||||||
$path = $name; // name may already contain absolut path
|
$path = $name; // name may already contain absolut path
|
||||||
}
|
}
|
||||||
// as some webservers does not report there DOCUMENT_ROOT starting with a '/', we just add one
|
if (!@is_readable($this->document_root . $path))
|
||||||
if (!@is_readable('/'.$_SERVER['DOCUMENT_ROOT'] . $path))
|
|
||||||
{
|
{
|
||||||
return $title;
|
return $title;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user