make given documentroot of domain relative to customerroot of no absolute path if given; fixes #892

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2020-10-14 16:58:19 +02:00
parent 0e8449f28d
commit 816874872d
2 changed files with 30 additions and 2 deletions

View File

@@ -1329,7 +1329,12 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
}
if (! preg_match('/^https?\:\/\//', $documentroot)) {
$documentroot = \Froxlor\FileDir::makeCorrectDir($documentroot);
if ($documentroot != $result['documentroot']) {
if (substr($documentroot, 0, 1) != "/") {
$documentroot = $customer['documentroot'] . '/' . $documentroot;
}
$documentroot = \Froxlor\FileDir::makeCorrectDir($documentroot);
}
}
if ($email_only == '1') {