return $type;
case 'serendipityPath':
- $test_path1 = $_SERVER['DOCUMENT_ROOT'] . rtrim(dirname($_SERVER['PHP_SELF']), '/') . '/';
+ if (empty($_SERVER['PHP_SELF'])) {
+ $test_path1 = $_SERVER['DOCUMENT_ROOT'] . rtrim(dirname($_SERVER['SCRIPT_FILENAME']), '/') . '/';
+ } else {
+ $test_path1 = $_SERVER['DOCUMENT_ROOT'] . rtrim(dirname($_SERVER['PHP_SELF']), '/') . '/';
+ }
$test_path2 = serendipity_getRealDir(__FILE__);
if (file_exists($test_path1 . 'serendipity_admin.php')) {
return $test_path1;
if (!is_dir($_POST['serendipityPath'])) {
$errs[] = sprintf(DIRECTORY_NON_EXISTANT, $_POST['serendipityPath']);
}
- /* This test has already been passed on the diagnosis page. Besides
+ /* This test has already been passed on the diagnosis page. Besides
it's a partially bogus test.
elseif (!is_writable($_POST['serendipityPath']) ) {
$errs[] = sprintf(DIRECTORY_WRITE_ERROR, $_POST['serendipityPath']);