Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -859,8 +859,9 @@ |
860 | 860 | /** |
861 | 861 | * Record a file upload in the upload log and the image table |
862 | 862 | */ |
863 | | - function recordUpload2( $oldver, $comment, $pageText, $props = false, $timestamp = false, $user = null ) |
864 | | - { |
| 863 | + function recordUpload2( |
| 864 | + $oldver, $comment, $pageText, $props = false, $timestamp = false, $user = null |
| 865 | + ) { |
865 | 866 | if ( is_null( $user ) ) { |
866 | 867 | global $wgUser; |
867 | 868 | $user = $wgUser; |
— | — | @@ -873,10 +874,14 @@ |
874 | 875 | $props = $this->repo->getFileProps( $this->getVirtualUrl() ); |
875 | 876 | } |
876 | 877 | |
| 878 | + if ( $timestamp === false ) { |
| 879 | + $timestamp = $dbw->timestamp(); |
| 880 | + } |
| 881 | + |
877 | 882 | $props['description'] = $comment; |
878 | 883 | $props['user'] = $user->getId(); |
879 | 884 | $props['user_text'] = $user->getName(); |
880 | | - $props['timestamp'] = wfTimestamp( TS_MW ); |
| 885 | + $props['timestamp'] = wfTimestamp( TS_MW, $timestamp ); // DB -> TS_MW |
881 | 886 | $this->setProps( $props ); |
882 | 887 | |
883 | 888 | # Delete thumbnails |
— | — | @@ -893,10 +898,6 @@ |
894 | 899 | |
895 | 900 | $reupload = false; |
896 | 901 | |
897 | | - if ( $timestamp === false ) { |
898 | | - $timestamp = $dbw->timestamp(); |
899 | | - } |
900 | | - |
901 | 902 | # Test to see if the row exists using INSERT IGNORE |
902 | 903 | # This avoids race conditions by locking the row until the commit, and also |
903 | 904 | # doesn't deadlock. SELECT FOR UPDATE causes a deadlock for every race condition. |