diff --git a/inc/lang/en/uploadmail.txt b/inc/lang/en/uploadmail.txt index 6fa196730de481ad9ebe11bb69002b388318a64a..932a1b704dcec8015d9bc1a24ec840e0a24cf2b8 100644 --- a/inc/lang/en/uploadmail.txt +++ b/inc/lang/en/uploadmail.txt @@ -1,13 +1,14 @@ A file was uploaded to your DokuWiki. Here are the details: -File : @MEDIA@ -Date : @DATE@ -Browser : @BROWSER@ -IP-Address : @IPADDRESS@ -Hostname : @HOSTNAME@ -Size : @SIZE@ -MIME Type : @MIME@ -User : @USER@ +File : @MEDIA@ +Old revision : @OLD@ +Date : @DATE@ +Browser : @BROWSER@ +IP-Address : @IPADDRESS@ +Hostname : @HOSTNAME@ +Size : @SIZE@ +MIME Type : @MIME@ +User : @USER@ -- This mail was generated by DokuWiki at diff --git a/inc/media.php b/inc/media.php index 141ba8c2c885b6107b9850769de7dffd70cb5fc4..76d25acd68990676dac6284a8e3ddc0a998ae592 100644 --- a/inc/media.php +++ b/inc/media.php @@ -398,7 +398,7 @@ function media_upload_finish($fn_tmp, $fn, $id, $imime, $overwrite, $move = 'mov // (Should normally chmod to $conf['fperm'] only if $conf['fperm'] is set.) chmod($fn, $conf['fmode']); msg($lang['uploadsucc'],1); - media_notify($id,$fn,$imime); + media_notify($id,$fn,$imime,$old); // add a log entry to the media changelog if ($REV){ addMediaLogEntry($new, $id, DOKU_CHANGE_TYPE_REVERT, $lang['restored'], $REV); @@ -485,7 +485,7 @@ function media_contentcheck($file,$mime){ * * @author Andreas Gohr <andi@splitbrain.org> */ -function media_notify($id,$file,$mime){ +function media_notify($id,$file,$mime,$old_rev=false){ global $lang; global $conf; global $INFO; @@ -503,6 +503,11 @@ function media_notify($id,$file,$mime){ $text = str_replace('@MIME@',$mime,$text); $text = str_replace('@MEDIA@',ml($id,'',true,'&',true),$text); $text = str_replace('@SIZE@',filesize_h(filesize($file)),$text); + if ($old_rev) { + $text = str_replace('@OLD@', ml($id, "rev=$old_rev", true, '&', true), $text); + } else { + $text = str_replace('@OLD@', '', $text); + } if(empty($conf['mailprefix'])) { $subject = '['.$conf['title'].'] '.$lang['mail_upload'].' '.$id;