MDL-61242 repository_equella: Add source key when sending the source.

A thank you to Nelson Cheng for find this issue and suggesting a patch.
This commit is contained in:
Adrian Greeve
2018-01-20 10:56:18 +08:00
parent f5b956679e
commit d05c2ac7cc

View File

@@ -60,6 +60,7 @@ if (isset($info->license)) {
}
$source = base64_encode(json_encode(array('url'=>$url,'filename'=>$filename)));
$sourcekey = sha1($source . repository::get_secret_key() . sesskey());
$js =<<<EOD
<html>
@@ -70,6 +71,7 @@ $js =<<<EOD
var resource = {};
resource.title = "$filename";
resource.source = "$source";
resource.sourcekey = "$sourcekey";
resource.thumbnail = '$thumbnail';
resource.author = "$author";
resource.license = "$license";