From 0f13c836f0ee71a3188a775b9ea64025e10d38f5 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Thu, 21 Nov 2013 18:02:12 +0100 Subject: Improved isCurrentRevision(), tests included --- inc/changelog.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'inc/changelog.php') diff --git a/inc/changelog.php b/inc/changelog.php index de26fdf6a..722365853 100644 --- a/inc/changelog.php +++ b/inc/changelog.php @@ -760,11 +760,12 @@ class PageRevisionLog { /** * Check whether given revision is the current page * - * @param int $rev timestamp of current page + * @param int $rev timestamp of current page + * @param bool $media look for media? * @return bool true if $rev is current revision, otherwise false */ - public function isCurrentRevision($rev){ - return isset($INFO['meta']['last_change']) && $rev == $INFO['meta']['last_change']['date']; + public function isCurrentRevision($rev, $media = false) { + return $rev == @filemtime($media ? mediaFN($this->id) : wikiFN($this->id)); } } -- cgit v1.2.3