From 53d68e69c328cb45f1f253bc775d7e53d6948680 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Fri, 20 Jan 2006 12:32:17 +0000 Subject: [PATCH] a fix for poor people that have no PHP_SELF. --- include/functions_installer.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/functions_installer.inc.php b/include/functions_installer.inc.php index 6c90eb8..057fa35 100644 --- a/include/functions_installer.inc.php +++ b/include/functions_installer.inc.php @@ -171,7 +171,11 @@ function serendipity_query_default($optname, $default, $usertemplate = false, $t 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; @@ -630,7 +634,7 @@ function serendipity_checkInstallation() { 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']); -- 2.39.5