fix domain.update() documentroot check
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -605,8 +605,6 @@ class Domains extends ApiCommand implements ResourceEntity
|
|||||||
} else {
|
} else {
|
||||||
if (strpos($documentroot, ':') !== false) {
|
if (strpos($documentroot, ':') !== false) {
|
||||||
Response::standardError('pathmaynotcontaincolon', '', true);
|
Response::standardError('pathmaynotcontaincolon', '', true);
|
||||||
} else {
|
|
||||||
$documentroot = FileDir::makeCorrectDir($documentroot);
|
|
||||||
}
|
}
|
||||||
$documentroot = FileDir::makeCorrectDir($documentroot);
|
$documentroot = FileDir::makeCorrectDir($documentroot);
|
||||||
}
|
}
|
||||||
@@ -1422,20 +1420,6 @@ class Domains extends ApiCommand implements ResourceEntity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$idna_convert = new IdnaWrapper();
|
|
||||||
if (preg_match('/^https?\:\/\//', $documentroot)) {
|
|
||||||
$encoded = $idna_convert->encode($documentroot);
|
|
||||||
if (!Validate::validateUrl($encoded, true)) {
|
|
||||||
Response::standardError('invaliddocumentrooturl', '', true);
|
|
||||||
}
|
|
||||||
$documentroot = $encoded;
|
|
||||||
} else {
|
|
||||||
if (strpos($documentroot, ':') !== false) {
|
|
||||||
Response::standardError('pathmaynotcontaincolon', '', true);
|
|
||||||
}
|
|
||||||
$documentroot = FileDir::makeCorrectDir($documentroot);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->getUserDetail('change_serversettings') == '1') {
|
if ($this->getUserDetail('change_serversettings') == '1') {
|
||||||
if (Settings::Get('system.bind_enable') == '1') {
|
if (Settings::Get('system.bind_enable') == '1') {
|
||||||
$zonefile = Validate::validate($zonefile, 'zonefile', '', '', [], true);
|
$zonefile = Validate::validate($zonefile, 'zonefile', '', '', [], true);
|
||||||
@@ -1602,11 +1586,21 @@ class Domains extends ApiCommand implements ResourceEntity
|
|||||||
$ssl_redirect = 2;
|
$ssl_redirect = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/^https?\:\/\//', $documentroot)) {
|
$idna_convert = new IdnaWrapper();
|
||||||
if ($documentroot != $result['documentroot']) {
|
if ($documentroot != $result['documentroot']) {
|
||||||
|
if (preg_match('/^https?\:\/\//', $documentroot)) {
|
||||||
|
$encoded = $idna_convert->encode($documentroot);
|
||||||
|
if (!Validate::validateUrl($encoded, true)) {
|
||||||
|
Response::standardError('invaliddocumentrooturl', '', true);
|
||||||
|
}
|
||||||
|
$documentroot = $encoded;
|
||||||
|
} else {
|
||||||
if (substr($documentroot, 0, 1) != "/") {
|
if (substr($documentroot, 0, 1) != "/") {
|
||||||
$documentroot = $customer['documentroot'] . '/' . $documentroot;
|
$documentroot = $customer['documentroot'] . '/' . $documentroot;
|
||||||
}
|
}
|
||||||
|
if (strpos($documentroot, ':') !== false) {
|
||||||
|
Response::standardError('pathmaynotcontaincolon', '', true);
|
||||||
|
}
|
||||||
$documentroot = FileDir::makeCorrectDir($documentroot);
|
$documentroot = FileDir::makeCorrectDir($documentroot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user