]> git.mjollnir.org Git - s9y.git/commitdiff
a fix for poor people that have no PHP_SELF.
authorgarvinhicking <garvinhicking>
Fri, 20 Jan 2006 12:32:17 +0000 (12:32 +0000)
committergarvinhicking <garvinhicking>
Fri, 20 Jan 2006 12:32:17 +0000 (12:32 +0000)
include/functions_installer.inc.php

index 6c90eb822754df973369bb5fcb183208cbf5813b..057fa35c622c3ed1ad39a7676184e6f4fdbfd0e5 100644 (file)
@@ -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']);