mirror of
https://github.com/24eme/signaturepdf
synced 2024-05-21 23:26:38 +02:00
add hardUnlink static method
This commit is contained in:
parent
87000db098
commit
488f720284
6
app.php
6
app.php
|
@ -230,7 +230,8 @@ $f3->route('POST /share',
|
|||
return basename($tmpfile."_".$fileBaseName);
|
||||
}
|
||||
});
|
||||
|
||||
array_map('cryptographyClass::hardUnlink', $_FILES['svg']['tmp_name']);
|
||||
CryptographyClass::hardUnlink($_FILES['pdf']['tmp_name']);
|
||||
if(!count($files)) {
|
||||
$f3->error(403);
|
||||
}
|
||||
|
@ -238,7 +239,7 @@ $f3->route('POST /share',
|
|||
shell_exec(sprintf("rsvg-convert -f pdf -o %s %s", $tmpfile.'.svg.pdf', $svgFiles));
|
||||
}
|
||||
if(!$f3->get('DEBUG')) {
|
||||
array_map('unlink', glob($tmpfile."*.svg"));
|
||||
array_map('cryptographyClass::hardUnlink', glob($tmpfile."*.svg"));
|
||||
}
|
||||
if (!isset($_COOKIE[$hash])) {
|
||||
$symmetric_key = createSymmetricKey();
|
||||
|
@ -247,6 +248,7 @@ $f3->route('POST /share',
|
|||
}
|
||||
$encryptor = new CryptographyClass($symmetric_key);
|
||||
$encryptor->encrypt($hash);
|
||||
|
||||
$f3->reroute($f3->get('REVERSE_PROXY_URL').'/signature/'.$hash."#sk:".$symmetric_key);
|
||||
}
|
||||
|
||||
|
|
|
@ -45,5 +45,11 @@ class CryptographyClass
|
|||
$this->symmetric_key = $key;
|
||||
}
|
||||
|
||||
public static function hardUnlink($element) {
|
||||
$eraser = str_repeat(0, strlen($element));
|
||||
file_put_contents($element, $eraser);
|
||||
unlink($element);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue