fixed checking of script path

This commit is contained in:
Roland Gruber 2003-08-03 13:29:44 +00:00
parent 2e40eab14b
commit fd9b28d917
2 changed files with 2 additions and 2 deletions

View File

@ -734,7 +734,7 @@ class Config {
// sets the path to the external script
function set_scriptPath($value) {
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;
return true;
}

View File

@ -182,7 +182,7 @@ if (($samba3 == "yes") && !eregi("^S-[0-9]-[0-9]-[0-9]{2,2}-[0-9]*-[0-9]*-[0-9]*
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 ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit;