renaming controller #342

This commit is contained in:
El RIDO 2018-07-29 15:17:35 +02:00
parent 90e83ddb30
commit f9c8441edb
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
10 changed files with 74 additions and 74 deletions

View file

@ -14,7 +14,7 @@ namespace PrivateBin\Model;
use Exception;
use PrivateBin\Persistence\ServerSalt;
use PrivateBin\PrivateBin;
use PrivateBin\Controller;
use PrivateBin\Sjcl;
/**
@ -35,14 +35,14 @@ class Paste extends AbstractModel
{
$data = $this->_store->read($this->getId());
if ($data === false) {
throw new Exception(PrivateBin::GENERIC_ERROR, 64);
throw new Exception(Controller::GENERIC_ERROR, 64);
}
// check if paste has expired and delete it if neccessary.
if (property_exists($data->meta, 'expire_date')) {
if ($data->meta->expire_date < time()) {
$this->delete();
throw new Exception(PrivateBin::GENERIC_ERROR, 63);
throw new Exception(Controller::GENERIC_ERROR, 63);
}
// We kindly provide the remaining time before expiration (in seconds)
$data->meta->remaining_time = $data->meta->expire_date - time();