diff options
author | Michael Hamann <michael@content-space.de> | 2011-09-08 11:27:42 +0200 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2011-09-08 11:39:00 +0200 |
commit | fb46ebd87eb43d5cd9f67f353f6656d0e3a0b196 (patch) | |
tree | b89b580659168d8550dcca66fb0c303389b77aaf /lib/exe/fetch.php | |
parent | aea34b5fe445064477d8ad0c98926db33a0d0851 (diff) | |
parent | cc2c0b9d6af82732ed79eeb85c22b7c3192a4e55 (diff) | |
download | rpg-fb46ebd87eb43d5cd9f67f353f6656d0e3a0b196.tar.gz rpg-fb46ebd87eb43d5cd9f67f353f6656d0e3a0b196.tar.bz2 |
Merge branch 'media-revisions'
This introduces a new media manager and media revisions to DokuWiki. The
changes have been implemented by Kate Arzamastseva and are the
result of a Google Summer of Code project, the official project page can
be found at
http://www.google-melange.com/gsoc/project/google/gsoc2011/kate/18001
Thanks to Kate for the work and Google for sponsoring it!
Diffstat (limited to 'lib/exe/fetch.php')
-rw-r--r-- | lib/exe/fetch.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/exe/fetch.php b/lib/exe/fetch.php index 3ad4f1937..143d40f22 100644 --- a/lib/exe/fetch.php +++ b/lib/exe/fetch.php @@ -20,6 +20,10 @@ $CACHE = calc_cache($_REQUEST['cache']); $WIDTH = (int) $_REQUEST['w']; $HEIGHT = (int) $_REQUEST['h']; + $REV = (int) @$_REQUEST['rev']; + //sanitize revision + $REV = preg_replace('/[^0-9]/','',$REV); + list($EXT,$MIME,$DL) = mimetype($MEDIA,false); if($EXT === false){ $EXT = 'unknown'; @@ -28,7 +32,7 @@ } // check for permissions, preconditions and cache external files - list($STATUS, $STATUSMESSAGE) = checkFileStatus($MEDIA, $FILE); + list($STATUS, $STATUSMESSAGE) = checkFileStatus($MEDIA, $FILE, $REV); // prepare data for plugin events $data = array('media' => $MEDIA, @@ -147,7 +151,7 @@ function sendFile($file,$mime,$dl,$cache){ * @param $file reference to the file variable * @returns array(STATUS, STATUSMESSAGE) */ -function checkFileStatus(&$media, &$file) { +function checkFileStatus(&$media, &$file, $rev='') { global $MIME, $EXT, $CACHE; //media to local file @@ -172,7 +176,7 @@ function checkFileStatus(&$media, &$file) { if(auth_quickaclcheck(getNS($media).':X') < AUTH_READ){ return array( 403, 'Forbidden' ); } - $file = mediaFN($media); + $file = mediaFN($media, $rev); } //check file existance |