mirror of https://github.com/BOINC/boinc.git
If sandbox link file does not exist, return an error
This commit is contained in:
parent
e5bdb008df
commit
166d9f46c0
|
@ -65,6 +65,7 @@ function sandbox_lf_exist($user, $md5) {
|
||||||
// parse a link file and return (error, size, md5)
|
// parse a link file and return (error, size, md5)
|
||||||
//
|
//
|
||||||
function sandbox_parse_link_file($path) {
|
function sandbox_parse_link_file($path) {
|
||||||
|
if (!file_exists($path)) { return array(true, null, null); }
|
||||||
$x = file_get_contents($path);
|
$x = file_get_contents($path);
|
||||||
$n = sscanf($x, "%s %d %s", $s, $size, $md5);
|
$n = sscanf($x, "%s %d %s", $s, $size, $md5);
|
||||||
if ($n != 3) return array(true, null, null);
|
if ($n != 3) return array(true, null, null);
|
||||||
|
@ -110,7 +111,7 @@ function sandbox_file_select($user, $select_name, $regexp = null, $allow_none =
|
||||||
}
|
}
|
||||||
$x = "<select name=$select_name>\n";
|
$x = "<select name=$select_name>\n";
|
||||||
if ($allow_none) {
|
if ($allow_none) {
|
||||||
$x .= "<option>--- None</option>\n";
|
$x .= "<option value=\"\">--- None</option>\n";
|
||||||
}
|
}
|
||||||
$files = sandbox_file_names($user);
|
$files = sandbox_file_names($user);
|
||||||
foreach ($files as $f) {
|
foreach ($files as $f) {
|
||||||
|
|
Loading…
Reference in New Issue