From 9191bc6c08d3be31c118a9f39da5df06b25f079c Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Thu, 22 Jul 2010 06:36:24 +0000 Subject: [PATCH] - don't cut single slash if diroptions path is equal to the docroot --- scripts/jobs/cron_tasks.inc.http.20.lighttpd.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php index 84689fb7..75b13f0f 100644 --- a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php +++ b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php @@ -522,7 +522,9 @@ class lighttpd mkDirWithCorrectOwnership($domain['documentroot'], $row['path'], $domain['guid'], $domain['guid']); // We need to remove the last slash, otherwise the regex wouldn't work - $path = substr($path, 0, -1); + if($row['path'] != $domain['documentroot']) { + $path = substr($path, 0, -1); + } $path_options.= ' $HTTP["url"] =~ "^' . $path . '($|/)" {' . "\n"; $path_options.= "\t" . 'dir-listing.activate = "enable"' . "\n"; $path_options.= ' }' . "\n\n"; @@ -539,7 +541,9 @@ class lighttpd mkDirWithCorrectOwnership($domain['documentroot'], $row['path'], $domain['guid'], $domain['guid']); // We need to remove the last slash, otherwise the regex wouldn't work - $path = substr($path, 0, -1); + if($row['path'] != $domain['documentroot']) { + $path = substr($path, 0, -1); + } $path_options.= ' $HTTP["url"] =~ "^' . $path . '($|/)" {' . "\n"; $path_options.= "\t" . 'cgi.assign = (' . "\n"; $path_options.= "\t\t" . '".pl" => "/usr/bin/perl",' . "\n";