Try to fixup DOCUMENT_ROOT in vhost rewrite scenarios; this SHOULD leave shared installs working.
This commit is contained in:
parent
e989cafe12
commit
13287acd12
@ -201,6 +201,10 @@ function serendipity_query_default($optname, $default, $usertemplate = false, $t
|
||||
$test_path1 = $_SERVER['DOCUMENT_ROOT'] . rtrim(dirname($_SERVER['PHP_SELF']), '/') . '/';
|
||||
}
|
||||
$test_path2 = serendipity_getRealDir(__FILE__);
|
||||
if (!empty($_SERVER['ORIG_PATH_TRANSLATED']) && file_exists(dirname($_SERVER['ORIG_PATH_TRANSLATED']) . '/serendipity_admin.php')) {
|
||||
return realpath(rtrim(dirname($_SERVER['ORIG_PATH_TRANSLATED'], '/'))) . '/';
|
||||
}
|
||||
|
||||
if (file_exists($test_path1 . 'serendipity_admin.php')) {
|
||||
return $test_path1;
|
||||
} elseif (defined('S9Y_DATA_PATH')) {
|
||||
@ -1053,6 +1057,10 @@ function serendipity_httpCoreDir() {
|
||||
return dirname($_SERVER['SCRIPT_FILENAME']) . '/';
|
||||
}
|
||||
|
||||
if (!empty($_SERVER['ORIG_PATH_TRANSLATED'])) {
|
||||
return dirname(realpath($_SERVER['ORIG_PATH_TRANSLATED'])) . '/';
|
||||
}
|
||||
|
||||
return $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/';
|
||||
}
|
||||
|
||||
|
@ -240,7 +240,9 @@ if (defined('IN_installer') && IS_installed === false) {
|
||||
* Make sure that the file included is in the current directory and not any possible
|
||||
* include path
|
||||
*/
|
||||
if (@file_exists($_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/serendipity_config_local.inc.php')) {
|
||||
if (!defined('S9Y_DATA_PATH') && file_exists(dirname(__FILE__) . '/serendipity_config_local.inc.php')) {
|
||||
$local_config = dirname(__FILE__) . '/serendipity_config_local.inc.php';
|
||||
} elseif (@file_exists($_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/serendipity_config_local.inc.php')) {
|
||||
$local_config = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/serendipity_config_local.inc.php';
|
||||
} elseif (defined('S9Y_DATA_PATH')) {
|
||||
// Shared installation!
|
||||
|
Loading…
x
Reference in New Issue
Block a user