Merge branch 'MDL-35983_equella_filename_dev' of git://github.com/dongsheng/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 8 Dec 2014 14:23:49 +0000 (14:23 +0000)
committerDan Poltawski <dan@moodle.com>
Mon, 8 Dec 2014 14:23:49 +0000 (14:23 +0000)
repository/equella/callback.php

index e8f25c9..dcc4838 100644 (file)
@@ -36,7 +36,11 @@ if (isset($info->url)) {
 }
 
 $filename = '';
-if (isset($info->name)) {
+// Use $info->filename if exists, $info->name is a display name,
+// it may not have extension
+if (isset($info->filename)) {
+    $filename  = s(clean_param($info->filename, PARAM_FILE));
+} else if (isset($info->name)) {
     $filename  = s(clean_param($info->name, PARAM_FILE));
 }