fixed checking of script path
This commit is contained in:
parent
2e40eab14b
commit
fd9b28d917
|
@ -734,7 +734,7 @@ class Config {
|
||||||
// sets the path to the external script
|
// sets the path to the external script
|
||||||
function set_scriptPath($value) {
|
function set_scriptPath($value) {
|
||||||
if (!$value) $this->scriptPath = ""; // optional parameter
|
if (!$value) $this->scriptPath = ""; // optional parameter
|
||||||
elseif (is_string($value) && eregi("^/([a-z0-9_\\-])+(/([a-z0-9_\\-])+)+$", $value)) $this->scriptPath = $value;
|
elseif (is_string($value) && eregi("^/([a-z0-9_\\-])+(/([a-z0-9_\\.\\-])+)+$", $value)) $this->scriptPath = $value;
|
||||||
else return false;
|
else return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,7 +182,7 @@ if (($samba3 == "yes") && !eregi("^S-[0-9]-[0-9]-[0-9]{2,2}-[0-9]*-[0-9]*-[0-9]*
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($scriptpath && !eregi("^/[a-z0-9_\\-]+(/[a-z0-9_\\-]+)+$", $scriptpath)) {
|
if ($scriptpath && !eregi("^/[a-z0-9_\\-]+(/[a-z0-9_\\.\\-]+)+$", $scriptpath)) {
|
||||||
echo ("<font color=\"red\"><b>" . _("Script path is invalid!") . "</b></font>");
|
echo ("<font color=\"red\"><b>" . _("Script path is invalid!") . "</b></font>");
|
||||||
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
||||||
exit;
|
exit;
|
||||||
|
|
Loading…
Reference in New Issue