MDL-32471 pluginfile.php accepts optional parameter 'preview'
This commit is contained in:
+2
-1
@@ -3211,9 +3211,10 @@ class filetype_parser {
|
||||
*
|
||||
* @param string $relativepath
|
||||
* @param bool $forcedownload
|
||||
* @param null|string $preview the preview mode, defaults to serving the original file
|
||||
* @todo MDL-31088 file serving improments
|
||||
*/
|
||||
function file_pluginfile($relativepath, $forcedownload) {
|
||||
function file_pluginfile($relativepath, $forcedownload, $preview = null) {
|
||||
global $DB, $CFG, $USER;
|
||||
// relative path must start with '/'
|
||||
if (!$relativepath) {
|
||||
|
||||
+2
-1
@@ -33,5 +33,6 @@ require_once('lib/filelib.php');
|
||||
|
||||
$relativepath = get_file_argument();
|
||||
$forcedownload = optional_param('forcedownload', 0, PARAM_BOOL);
|
||||
$preview = optional_param('preview', null, PARAM_ALPHANUM);
|
||||
|
||||
file_pluginfile($relativepath, $forcedownload);
|
||||
file_pluginfile($relativepath, $forcedownload, $preview);
|
||||
|
||||
Reference in New Issue
Block a user