From 92a82908b891fbb8df57facfdf7df0f89ee74fc7 Mon Sep 17 00:00:00 2001 From: mutec Date: Mon, 7 Oct 2019 12:16:03 +0200 Subject: [PATCH] fix apache rewrite generation Before this change the system wasn't able to handle nested directories properly. A multidomain-setup using a different domain for every app and having them on the same file tree level was required for a valid output. Now it's handling the "default"-case properly which might be one app at `/` and others in sub-directories. Technical: The algorithm didn't decide correctly if an app is placed in a sub-directory of another app. Now it's removing extra htaccess-files for those sub-directories and places everything correctly in the highest folder handling every app and the root-app at last. --- .../files/lib/data/option/OptionAction.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/data/option/OptionAction.class.php b/wcfsetup/install/files/lib/data/option/OptionAction.class.php index 6a35e274dc..8dcfee9ac1 100644 --- a/wcfsetup/install/files/lib/data/option/OptionAction.class.php +++ b/wcfsetup/install/files/lib/data/option/OptionAction.class.php @@ -148,8 +148,6 @@ class OptionAction extends AbstractDatabaseObjectAction { foreach ($dirs as $dir => $apps) { if (strpos($dir, $test) !== false) { unset($dirs[$dir]); - $insert = false; - break; } else if (strpos($test, $dir) !== false) { $insert = false; @@ -173,14 +171,16 @@ class OptionAction extends AbstractDatabaseObjectAction { foreach ($domainPaths as $domainPath => $value) { $htaccess = "{$dir}.htaccess"; - if (empty($rules['apache'][$htaccess])) { - $path = FileUtil::removeTrailingSlash(substr($value, strlen($dir))); - $rules['apache'][$htaccess] = <<