LocalFile: Ensure same timestamp for log entry and image revision
authorBartosz Dziewoński <matma.rex@gmail.com>
Sun, 24 Jan 2016 20:31:34 +0000 (21:31 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Sun, 24 Jan 2016 20:31:34 +0000 (21:31 +0100)
For file patrolling, we rely on the timestamp of image revision
(`image` table) and log entry (`logging` table) being the same, but we
weren't actually making sure it is the same.

Note that the timestamp of page revision can still differ, but that
shouldn't matter and it's a more involved fix.

Change-Id: I8e1b75d744c4a96cb0bb636b153d6e8ea2ee1fcf

includes/filerepo/file/LocalFile.php

index 9e214f6..2b5a4e6 100644 (file)
@@ -1355,6 +1355,7 @@ class LocalFile extends File {
 
                // Add the log entry...
                $logEntry = new ManualLogEntry( 'upload', $reupload ? 'overwrite' : 'upload' );
+               $logEntry->setTimestamp( $this->timestamp );
                $logEntry->setPerformer( $user );
                $logEntry->setComment( $comment );
                $logEntry->setTarget( $descTitle );