MDL-32117 equella: various E_STRICT fixes

* Make send_file compatible with its parent
* mktime -> time()
* callback.php: fix pass by reference warnings
This commit is contained in:
Dan Poltawski
2012-06-04 12:29:15 +08:00
parent e88aa1e34c
commit 130b3f8c4f
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -27,7 +27,8 @@ require_once(dirname(dirname(__FILE__)).'/lib.php');
require_login();
$json = required_param('tlelinks', PARAM_RAW);
$info = array_pop(json_decode($json));
$decodedinfo = json_decode($json);
$info = array_pop($decodedinfo);
$url = clean_param($info->url, PARAM_URL);
$thumbnail = clean_param($info->thumbnail, PARAM_URL);
$filename = clean_param($info->name, PARAM_FILE);
+2 -2
View File
@@ -156,7 +156,7 @@ class repository_equella extends repository {
*
* @param stored_file $stored_file
*/
public function send_file($stored_file) {
public function send_file($stored_file, $lifetime=86400 , $filter=0, $forcedownload=false, array $options = null) {
$reference = base64_decode($stored_file->get_reference());
$url = $this->appendtoken($reference);
header('Location: ' . $url);
@@ -218,7 +218,7 @@ class repository_equella extends repository {
* @return string
*/
function getssotoken_raw($username, $shareid, $sharedsecret) {
$time = mktime() . '000';
$time = time() . '000';
return urlencode($username)
. ':'
. $shareid