try to reduce weird path-values when people are getting creative, fixes #487
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -327,6 +327,9 @@ if ($page == 'overview') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/^https?\:\/\//', $path) || !validateUrl($path)) {
|
if (!preg_match('/^https?\:\/\//', $path) || !validateUrl($path)) {
|
||||||
|
if (strstr($path, ":") !== FALSE) {
|
||||||
|
standard_error('pathmaynotcontaincolon');
|
||||||
|
}
|
||||||
// If path is empty or '/' and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
|
// If path is empty or '/' and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
|
||||||
// set default path to subdomain or domain name
|
// set default path to subdomain or domain name
|
||||||
if ((($path == '') || ($path == '/')) && Settings::Get('system.documentroot_use_default_value') == 1) {
|
if ((($path == '') || ($path == '/')) && Settings::Get('system.documentroot_use_default_value') == 1) {
|
||||||
@@ -334,9 +337,6 @@ if ($page == 'overview') {
|
|||||||
} else {
|
} else {
|
||||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||||
}
|
}
|
||||||
if (strstr($path, ":") !== FALSE) {
|
|
||||||
standard_error('pathmaynotcontaincolon');
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$_doredirect = true;
|
$_doredirect = true;
|
||||||
}
|
}
|
||||||
@@ -571,6 +571,9 @@ if ($page == 'overview') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/^https?\:\/\//', $path) || !validateUrl($path)) {
|
if (!preg_match('/^https?\:\/\//', $path) || !validateUrl($path)) {
|
||||||
|
if (strstr($path, ":") !== FALSE) {
|
||||||
|
standard_error('pathmaynotcontaincolon');
|
||||||
|
}
|
||||||
// If path is empty or '/' and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
|
// If path is empty or '/' and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
|
||||||
// set default path to subdomain or domain name
|
// set default path to subdomain or domain name
|
||||||
if ((($path == '') || ($path == '/')) && Settings::Get('system.documentroot_use_default_value') == 1) {
|
if ((($path == '') || ($path == '/')) && Settings::Get('system.documentroot_use_default_value') == 1) {
|
||||||
@@ -578,9 +581,6 @@ if ($page == 'overview') {
|
|||||||
} else {
|
} else {
|
||||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||||
}
|
}
|
||||||
if (strstr($path, ":") !== FALSE) {
|
|
||||||
standard_error('pathmaynotcontaincolon');
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$_doredirect = true;
|
$_doredirect = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user