/**
* Record a file upload in the upload log and the image table
*/
- function recordUpload2( $oldver, $comment, $pageText, $props = false, $timestamp = false, $user = null )
- {
+ function recordUpload2(
+ $oldver, $comment, $pageText, $props = false, $timestamp = false, $user = null
+ ) {
if ( is_null( $user ) ) {
global $wgUser;
$user = $wgUser;
$props = $this->repo->getFileProps( $this->getVirtualUrl() );
}
+ if ( $timestamp === false ) {
+ $timestamp = $dbw->timestamp();
+ }
+
$props['description'] = $comment;
$props['user'] = $user->getId();
$props['user_text'] = $user->getName();
- $props['timestamp'] = wfTimestamp( TS_MW );
+ $props['timestamp'] = wfTimestamp( TS_MW, $timestamp ); // DB -> TS_MW
$this->setProps( $props );
# Delete thumbnails
$reupload = false;
- if ( $timestamp === false ) {
- $timestamp = $dbw->timestamp();
- }
-
# Test to see if the row exists using INSERT IGNORE
# This avoids race conditions by locking the row until the commit, and also
# doesn't deadlock. SELECT FOR UPDATE causes a deadlock for every race condition.