* (This doesn't check $user's permissions.)
* @param bool $createNullRevision Set to false to avoid creation of a null revision on file
* upload, see T193621
* (This doesn't check $user's permissions.)
* @param bool $createNullRevision Set to false to avoid creation of a null revision on file
* upload, see T193621
* @return Status On success, the value member contains the
* archive name, or an empty string if it was a new file.
*/
function upload( $src, $comment, $pageText, $flags = 0, $props = false,
$timestamp = false, $user = null, $tags = [],
* @return Status On success, the value member contains the
* archive name, or an empty string if it was a new file.
*/
function upload( $src, $comment, $pageText, $flags = 0, $props = false,
$timestamp = false, $user = null, $tags = [],
* @return Status
*/
function recordUpload2(
$oldver, $comment, $pageText, $props = false, $timestamp = false, $user = null, $tags = [],
* @return Status
*/
function recordUpload2(
$oldver, $comment, $pageText, $props = false, $timestamp = false, $user = null, $tags = [],
+ // Determine log action. If reupload is done by reverting, use a special log_action.
+ if ( $revert === true ) {
+ $logAction = 'revert';
+ } elseif ( $reupload === true ) {
+ $logAction = 'overwrite';
+ } else {
+ $logAction = 'upload';
+ }
$logEntry->setTimestamp( $this->timestamp );
$logEntry->setPerformer( $user );
$logEntry->setComment( $comment );
$logEntry->setTimestamp( $this->timestamp );
$logEntry->setPerformer( $user );
$logEntry->setComment( $comment );
- $archiveName = wfTimestamp( TS_MW ) . '!' . $this->getName();
- $archiveRel = $this->getArchiveRel( $archiveName );
+ if ( $this->isOld() ) {
+ $archiveRel = $dstRel;
+ $archiveName = basename( $archiveRel );
+ } else {
+ $archiveName = wfTimestamp( TS_MW ) . '!' . $this->getName();
+ $archiveRel = $this->getArchiveRel( $archiveName );
+ }