implement chrono privacy for pastes, addresses #1290

This commit is contained in:
El RIDO
2024-05-01 20:16:03 +02:00
parent ec02afca04
commit a9f1926b96
9 changed files with 24 additions and 29 deletions
+1 -2
View File
@@ -37,7 +37,7 @@ class Paste extends AbstractModel
throw new Exception(Controller::GENERIC_ERROR, 64);
}
// check if paste has expired and delete it if neccessary.
// check if paste has expired and delete it if necessary.
if (array_key_exists('expire_date', $data['meta'])) {
if ($data['meta']['expire_date'] < time()) {
$this->delete();
@@ -92,7 +92,6 @@ class Paste extends AbstractModel
throw new Exception('You are unlucky. Try again.', 75);
}
$this->_data['meta']['created'] = time();
$this->_data['meta']['salt'] = ServerSalt::generate();
// store paste