Index: branches/wmf/1.17wmf1/includes/filerepo/LocalFile.php |
— | — | @@ -850,8 +850,9 @@ |
851 | 851 | /** |
852 | 852 | * Record a file upload in the upload log and the image table |
853 | 853 | */ |
854 | | - function recordUpload2( $oldver, $comment, $pageText, $props = false, $timestamp = false, $user = null ) |
855 | | - { |
| 854 | + function recordUpload2( |
| 855 | + $oldver, $comment, $pageText, $props = false, $timestamp = false, $user = null |
| 856 | + ) { |
856 | 857 | if ( is_null( $user ) ) { |
857 | 858 | global $wgUser; |
858 | 859 | $user = $wgUser; |
— | — | @@ -864,10 +865,14 @@ |
865 | 866 | $props = $this->repo->getFileProps( $this->getVirtualUrl() ); |
866 | 867 | } |
867 | 868 | |
| 869 | + if ( $timestamp === false ) { |
| 870 | + $timestamp = $dbw->timestamp(); |
| 871 | + } |
| 872 | + |
868 | 873 | $props['description'] = $comment; |
869 | 874 | $props['user'] = $user->getId(); |
870 | 875 | $props['user_text'] = $user->getName(); |
871 | | - $props['timestamp'] = wfTimestamp( TS_MW ); |
| 876 | + $props['timestamp'] = wfTimestamp( TS_MW, $timestamp ); // DB -> TS_MW |
872 | 877 | $this->setProps( $props ); |
873 | 878 | |
874 | 879 | # Delete thumbnails |
— | — | @@ -884,10 +889,6 @@ |
885 | 890 | |
886 | 891 | $reupload = false; |
887 | 892 | |
888 | | - if ( $timestamp === false ) { |
889 | | - $timestamp = $dbw->timestamp(); |
890 | | - } |
891 | | - |
892 | 893 | # Test to see if the row exists using INSERT IGNORE |
893 | 894 | # This avoids race conditions by locking the row until the commit, and also |
894 | 895 | # doesn't deadlock. SELECT FOR UPDATE causes a deadlock for every race condition. |
Property changes on: branches/wmf/1.17wmf1/includes/filerepo/LocalFile.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
895 | 896 | Merged /branches/sqlite/includes/filerepo/LocalFile.php:r58211-58321 |
896 | 897 | Merged /trunk/phase3/includes/filerepo/LocalFile.php:r83590,85199 |
897 | 898 | Merged /branches/new-installer/phase3/includes/filerepo/LocalFile.php:r43664-66004 |
898 | 899 | Merged /branches/wmf-deployment/includes/filerepo/LocalFile.php:r53381,60970 |
899 | 900 | Merged /branches/REL1_15/phase3/includes/filerepo/LocalFile.php:r51646 |
900 | 901 | Merged /branches/wmf/1.16wmf4/includes/filerepo/LocalFile.php:r67177,69199,76243,77266 |