From: garvinhicking <garvinhicking> Date: Fri, 20 Jan 2006 12:32:17 +0000 (+0000) Subject: a fix for poor people that have no PHP_SELF. X-Git-Tag: 1.0~163 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=53d68e69c328cb45f1f253bc775d7e53d6948680;p=s9y.git a fix for poor people that have no PHP_SELF. --- 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']);