made all php unit tests pass again

This commit is contained in:
El RIDO 2019-05-10 07:55:39 +02:00
parent 59569bf9fc
commit 700f8a0ea7
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
11 changed files with 158 additions and 255 deletions

View file

@ -190,11 +190,11 @@ class Filesystem extends AbstractData
$comment = DataStore::get($discdir . $filename);
$items = explode('.', $filename);
// Add some meta information not contained in file.
$comment->id = $items[1];
$comment->parentid = $items[2];
$comment['id'] = $items[1];
$comment['parentid'] = $items[2];
// Store in array
$key = $this->getOpenSlot($comments, (int) $comment->meta->postdate);
$key = $this->getOpenSlot($comments, (int) $comment['meta']['created']);
$comments[$key] = $comment;
}
}
@ -283,8 +283,8 @@ class Filesystem extends AbstractData
if ($this->exists($pasteid)) {
$data = $this->read($pasteid);
if (
property_exists($data->meta, 'expire_date') &&
$data->meta->expire_date < time()
array_key_exists('expire_date', $data['meta']) &&
$data['meta']['expire_date'] < time()
) {
$pastes[] = $pasteid;
if (count($pastes) >= $batchsize) {