summaryrefslogtreecommitdiff
path: root/inc/changelog.php
diff options
context:
space:
mode:
authorGerrit Uitslag <klapinklapin@gmail.com>2014-12-09 17:26:28 +0100
committerGerrit Uitslag <klapinklapin@gmail.com>2014-12-09 17:26:28 +0100
commit8702de7f7e170bddfdb622c393c3cac3446fd1c5 (patch)
treec7269ea61f5d4230a6f916dbabee4ce412e0a9fb /inc/changelog.php
parent1cc82e5c76ae7fcd646e448404afdc0fd458bf55 (diff)
parent9a0ca2cfd8ac42895af3be2efbd2cab7e6d33578 (diff)
downloadrpg-8702de7f7e170bddfdb622c393c3cac3446fd1c5.tar.gz
rpg-8702de7f7e170bddfdb622c393c3cac3446fd1c5.tar.bz2
Merge remote-tracking branch 'origin/master' into scrutinizerissues
Conflicts: inc/media.php inc/plugin.php inc/template.php lib/plugins/authplain/_test/escaping.test.php lib/plugins/syntax.php
Diffstat (limited to 'inc/changelog.php')
-rw-r--r--inc/changelog.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/inc/changelog.php b/inc/changelog.php
index e2826e4b3..cb3cd2aeb 100644
--- a/inc/changelog.php
+++ b/inc/changelog.php
@@ -847,6 +847,25 @@ abstract class ChangeLog {
public function isCurrentRevision($rev) {
return $rev == @filemtime($this->getFilename());
}
+
+ /**
+ * Return an existing revision for a specific date which is
+ * the current one or younger or equal then the date
+ *
+ * @param string $id
+ * @param number $date_at timestamp
+ * @return string revision ('' for current)
+ */
+ function getLastRevisionAt($date_at){
+ //requested date_at(timestamp) younger or equal then modified_time($this->id) => load current
+ if($date_at >= @filemtime($this->getFilename())) {
+ return '';
+ } else if ($rev = $this->getRelativeRevision($date_at+1, -1)) { //+1 to get also the requested date revision
+ return $rev;
+ } else {
+ return false;
+ }
+ }
/**
* Returns the next lines of the changelog of the chunck before head or after tail
@@ -1074,3 +1093,4 @@ function getRevisions($id, $first, $num, $chunk_size = 8192, $media = false) {
}
return $changelog->getRevisions($first, $num);
}
+