Skip to content
Snippets Groups Projects
Commit 2e38f579 authored by Michael Hamann's avatar Michael Hamann
Browse files

RemoteAPICore: do not rely on timestamps of saved revisions

This fixes the remote API's relying on timestamps of files in the attic
directory. While the timestamp of the current page is always the
revision (and actually how the timestamp of the revision is determined),
timestamps of attic files do not necessarily match the revision they
represent. This should also fix random test failures in the remote api
tests.
parent 2d69eb44
No related branches found
No related tags found
No related merge requests found
......@@ -449,14 +449,20 @@ class RemoteAPICore {
throw new RemoteException('The requested page does not exist', 121);
}
// set revision to current version if empty, use revision otherwise
// as the timestamps of old files are not necessarily correct
if($rev === '') {
$rev = $time;
}
$pagelog = new PageChangeLog($id, 1024);
$info = $pagelog->getRevisionInfo($time);
$info = $pagelog->getRevisionInfo($rev);
$data = array(
'name' => $id,
'lastModified' => $this->api->toDate($time),
'lastModified' => $this->api->toDate($rev),
'author' => (($info['user']) ? $info['user'] : $info['ip']),
'version' => $time
'version' => $rev
);
return ($data);
......@@ -806,7 +812,7 @@ class RemoteAPICore {
// specified via $conf['recent']
if($time){
$pagelog->setChunkSize(1024);
$info = $pagelog->getRevisionInfo($time);
$info = $pagelog->getRevisionInfo($rev ? $rev : $time);
if(!empty($info)) {
$data = array();
$data['user'] = $info['user'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment