Merge branch 'release/1.2.5'

This commit is contained in:
Flavio Copes 2016-09-16 09:51:49 +02:00
commit 22735aed31
3 changed files with 7 additions and 6 deletions

View File

@ -1,3 +1,9 @@
# v1.2.5
## 09/16/2016
1. [](#bugfix)
* Fix [#37](https://github.com/getgrav/grav-plugin-comments/issues/37) showing comments older than one week in the "latest comments" view
# v1.2.4
## 09/15/2016

View File

@ -1,5 +1,5 @@
name: Comments
version: 1.2.4
version: 1.2.5
description: Adds a commenting functionality to your site
icon: comment
author:

View File

@ -312,11 +312,6 @@ class CommentsPlugin extends Plugin
for ($i = 0; $i < count($data['comments']); $i++) {
$commentTimestamp = \DateTime::createFromFormat('D, d M Y H:i:s', $data['comments'][$i]['date'])->getTimestamp();
$sevenDaysAgo = time() - (7 * 24 * 60 * 60);
if ($commentTimestamp < $sevenDaysAgo) {
continue;
}
$data['comments'][$i]['pageTitle'] = $data['title'];
$data['comments'][$i]['filePath'] = $file->filePath;