error codes sur page read
This commit is contained in:
parent
acd0796f5f
commit
ebda5ef7cb
@ -84,7 +84,6 @@ function share_list($dir)
|
|||||||
{
|
{
|
||||||
$tsv = tsv_path($child);
|
$tsv = tsv_path($child);
|
||||||
|
|
||||||
var_dump(is_file($tsv));
|
|
||||||
if (is_file($tsv))
|
if (is_file($tsv))
|
||||||
{
|
{
|
||||||
return array_merge($carry, read_tsv($child, $tsv));
|
return array_merge($carry, read_tsv($child, $tsv));
|
||||||
@ -206,9 +205,16 @@ function find_share($dir, $creation)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function error_code($int)
|
||||||
|
{
|
||||||
|
header("Location: /", TRUE, $int);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
function _($var)
|
function _($var)
|
||||||
{
|
{
|
||||||
print($var);
|
print($var);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -9,8 +9,17 @@ if (isset($_GET['id']))
|
|||||||
{
|
{
|
||||||
if (gen_identifier($share) == $_GET['id'])
|
if (gen_identifier($share) == $_GET['id'])
|
||||||
{
|
{
|
||||||
|
$expires_date = DateTime::createFromFormat(
|
||||||
|
DateTimeInterface::ISO8601,
|
||||||
|
$share['expires']
|
||||||
|
);
|
||||||
|
if ($expires_date < (new DateTime()))
|
||||||
|
{
|
||||||
|
error_code(410);
|
||||||
|
}
|
||||||
zip_response($share['dir']);
|
zip_response($share['dir']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
error_code(403);
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user